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?
bbPress ShowcasebbPress Showcase
bbPress Showcase » Plugins by _ck_
-
Posted 2 years ago #
-
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 # -
docx has the mime type
application/vnd.openxmlformats-officedocument.wordprocessingml.documentyou probably have to add that to the list
Posted 2 years ago # -
_ck_ - 14 hours ago »
docx has the mime typeapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentyou 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 uploadStill resulted in an error.
1. [docx] [denied extension] Weekly_Report_09-24-2010.docx (7.5 KB)
Posted 2 years ago # -
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
docxto each level and see if that fixes it for you?Posted 2 years ago # -
Try adding
docxto 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 # -
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 herePosted 1 year ago # -
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 777Posted 1 year ago # -
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 # -
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