Search

bbPress Showcase » Plugins by _ck_

  1. fil.diesel
    fil.diesel

    junior member
    Joined: Jul '10
    Posts: 5

    offline

    tried to add the bb-attachments.php
    $output.=" <small> Paste in the post "."[attachment=$post_id,$id]"."</small> ";
    $post_id-shows,$id-does not show.
    How to show id attachments?

    Posted 2 years ago #
  2. ntwrkguru
    User has not uploaded an avatar

    new member
    Joined: Sep '10
    Posts: 3

    offline

    What is needed to allow more file types? Specifically, docx and xlsx. I have modified bb-attachment.php as such:

    $bb_attachments['allowed']['extensions']['default']=array('gif','jpeg','jpg','pdf','png','txt','doc','xls','docx','zip'); // anyone who can upload can submit these
    $bb_attachments['allowed']['extensions']['moderate']=array('gif','gz','jpeg','jpg','pdf','png','txt','zip'); // only if they can moderate
    $bb_attachments['allowed']['extensions']['administrate']=array('bmp','doc','gif','gz','jpeg','jpg','pdf','png','txt','xls','zip'); // only if they can administrate

    $bb_attachments['allowed']['mime_types']['default']=array('application/octet-stream','text/plain', 'image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'application/pdf', 'application/x-pdf'); // for anyone that can upload
    $bb_attachments['allowed']['mime_types']['moderate']=array('application/octet-stream','text/plain', 'image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'application/pdf', 'application/x-pdf', 'application/zip', 'application/x-zip' , 'application/x-gzip');
    $bb_attachments['allowed']['mime_types']['administrate']=array('application/octet-stream', 'text/plain', 'text/x-c', 'image/bmp', 'image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'application/pdf', 'application/x-pdf', 'application/zip', 'application/x-zip' , 'application/x-gzip');

    But I still get an error on upload for docx, etc. "Normal" files, i.e. pdf are fine. What else needs to be modified?

    Thanks.

    Posted 2 years ago #
  3. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 900

    offline

    docx has the mime type

    application/vnd.openxmlformats-officedocument.wordprocessingml.document

    you probably have to add that to the list

    Posted 2 years ago #
  4. ntwrkguru
    User has not uploaded an avatar

    new member
    Joined: Sep '10
    Posts: 3

    offline

    _ck_ - 14 hours ago  » 
    docx has the mime type

    application/vnd.openxmlformats-officedocument.wordprocessingml.document

    you probably have to add that to the list

    $bb_attachments['allowed']['mime_types']['default']=array('application/octet-stream','text/plain', 'image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'application/pdf', 'application/x-pdf','application/vnd.openxmlformats-officedocument.wordprocessingml.document'); // for anyone that can upload

    Still resulted in an error.

    1. [docx] [denied extension] Weekly_Report_09-24-2010.docx (7.5 KB)

    Posted 2 years ago #
  5. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 900

    offline

    Ah it's a denied extension error so it's not the mime.

    It's not a bug with extension length, I allow any length.

    I wonder if it's a bug that it's not in administrate and you are trying to upload as an administrator?

    Yup - looking quickly at my code, the allowances are not inherited, they are unique to each level - that's actually a mistake on my part.

    Try adding docx to each level and see if that fixes it for you?

    Posted 2 years ago #
  6. ntwrkguru
    User has not uploaded an avatar

    new member
    Joined: Sep '10
    Posts: 3

    offline

    Try adding docx to each level and see if that fixes it for you?

    That did it. Thanks for the quick response and putting up with my ignorance.

    Great plugin!

    Posted 2 years ago #
  7. daveperry
    User has not uploaded an avatar

    new member
    Joined: Sep '11
    Posts: 3

    offline

    i think i have a similar problem as stated above.
    my root directory is /home/www/web341/ and i can't create a new directory within that.
    having the plugin file not changed: everything seems to work fine, the file seems to have uploaded. But it did not, and clicking on it prevails a white page.
    haveing the pluging file changed to some working directory (with 777): failure message after trying to upload (not a php error message, just in the forum, right after the file name).
    s.th. i weird here

    Posted 1 year ago #
  8. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 900

    offline

    my root directory is /home/www/web341/ and i can't create a new directory within that.

    If you cannot create a new directory with chmod 777, then you won't be able to use this plugin. It has to be somewhere, above /www/ is preferred for extra security but even below /web341/ is required -

    See if you can use your ftp program and make
    /home/www/web341/uploads/
    and change perms to 777

    Posted 1 year ago #
  9. daveperry
    User has not uploaded an avatar

    new member
    Joined: Sep '11
    Posts: 3

    offline

    ok... i talked to someone from the host. they told me that they could create a folder for me. so there is a folder called "files" (with chmod 777) now, on the same level as the html folder. not quite sure if accessible from the domain though. i tried to do it with that folder, but maybe i didn't change the right thing in the plugin file.
    I did

    $bb_attachments['path']=dirname($_SERVER['DOCUMENT_ROOT'])."/files/";

    but there is this failure message. as i said, if i leave
    $bb_attachments['path']=dirname($_SERVER['DOCUMENT_ROOT'])."/bb-attachments/";
    there is no failure message. even if the the folder doesn't even exist

    Posted 1 year ago #
  10. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 900

    offline

    The way bb-attachments works is after the file is uploaded to the server's temporary area (tmp) it examines it and if everything is okay, the last thing it does is use a special php function to move the file from the tmp area to the specified directory and rename it.

    It's possible 'document_root' is giving you bad info, so just change $bb_attachments['path']= to the exact full directory path as you understand it.

    You can run phpinfo from the webroot and then look at _SERVER["SCRIPT_FILENAME"] to get an idea of what the real path it and then go one above the webroot and add the directory they created for you.

    Posted 1 year ago #

RSS feed for this topic

Post a reply to “new bbPress plugin: bbPress Attachments” »

You must log in to post.

keep _ck_ coding >> donate $5 <<     Theme Switcher:
49 users online from in the past 30 minutes. 7 bots 42 guests
1,217 views today 10,647 yesterday 89,978 peak. Most at once 50 today 87 yesterday 539 peak.
2,408 posts in 414 topics over 78 months by 445 of 2,508 members. Latest: walkerthomac, elena0429, dancome89