bbPress as of now doesn’t allow any uploading feature with native support and the famous bb_attachments plugin which was developed for bbPress 0.9 versions doesn’t work with bbPress 1.0+ releases. For those who are new to this plugin, it adds uploading capabilities to your bbPress forum. Users can now upload files from their computer instead of uploading it to file sharing services and then sharing the URL. I have aggregated the information on how it can fixed from the Extends section of the bbPress.org
Here is how you can fix it :
- Download the 0.2.7 version of the plugin from the Extends section.
- Upload it to the my-plugins folder under your bbPress root. (Make sure file permissions of my-plugins & my-templates are 755. (How to fix file permissions of my-plugins & my-templates folder)
- Make a directory /bb-attachments/ above your webroot i.e. just above the folder which is accessible on internet. (This is for security purposes)
- Set file permissions of the bb-attachments folder to 777. (If you don’t know how to change the file permissions then follow the steps of the link given in step #2)
- Make sure that bb_attachments table has been created in your database. You can use phpMyAdmin to check. If its not there, you can run this SQL query to create it :
CREATE TABLE IF NOT EXISTS bb_attachments ( id int(10) UNSIGNED NOT NULL auto_increment, time int(10) UNSIGNED NOT NULL default 0, post_id int(10) UNSIGNED NOT NULL default 0, user_id int(10) UNSIGNED NOT NULL default 0, user_ip int(10) UNSIGNED NOT NULL default 0, status tinyint(10) UNSIGNED NOT NULL default 0, downloads int(10) UNSIGNED NOT NULL default 0, size int(10) UNSIGNED NOT NULL default 0, ext varchar(255) NOT NULL default '', mime varchar(255) NOT NULL default '', filename varchar(255) NOT NULL default '', PRIMARY KEY (id), INDEX (post_id) ) CHARSET utf8 COLLATE utf8_general_ci;
$bb_attachments['path']=dirname($_SERVER['DOCUMENT_ROOT'])."/bb-attachments/";
If you face any issues, then leave a comment here and I will try to help.
Comments
21 responses to “Fix bb-attachments plugin of bbPress”
I don’t have a problem uploading all files, just .doc and .xls files. The newer .docx and .xlsx files upload just fine and all other file types (.pdf, .jpg, etc.) work without any issue as well. I’ve tried adding every MIME type I could think of, and as I want all of my users to have the same upload permissions, I’ve made the changes at all levels, yet none can upload .doc or .xls.
Got the same problem as Shane. Everything works fine but .doc and xml extensions. I’m trying to find any solutions on the plugin board right now.
🙁
@Shane @María
I will take a look at it after our festive season is over here! (1 week)
Hi!
Thanks a lot for your answer.
I think I found the problem – the mime type for .doc files was just not spelled correctly for my server, I guess. Tried different options and finally the one that worked fine is ‘application/msword’.
Have a nice holiday!
🙂
@María
Thanks for posting how you fix it. That will surely help someone. 🙂
Unfortunately, that MIME type is already in the MIME list on my server and in my php file. I still can not attach .doc files.
Hello !
Done exactly as instructed, it worked fine, database created.
Path is ok (i m sure cause i harcoded it and tested it)
Chmod is ok
When i upload , it creates the right record in the table but do not put the file in the right directory, does not put the file at all as i know.
Any idea ?
Thanks,
Jean (France)
@Shane @Jean
Try asking on the plugin’s page. I don’t know about the plugin in detail. So, its better to ask CK, the coder of the plugin.
So easy, Thanks!!!
I hava found the problem and fixed it.My host is GoDaddy and type is windows,so the correct path should be dirname($_SERVER[‘DOCUMENT_ROOT’]).”\\html\\bb-attachments\\”
Good that you fixed it!
Got the attachment plugin working but wanted to know how can one tweak the upload size limit. For example for non-members, members, moderators or the administrator.
Thanks!
You will have to code to check the user role and according to that set the upload size limit constant. If you are not into coding, then this will be really hard for you.
Hey Ashish,
Thanks for your reply.
I was able to edit the plugin file and set different upload limit for members and administrators.
– Ravin Mohindru
Glad that you figured it out 🙂
That’s a subtle way of tinhnkig about it.
hi!
🙁 uff
when I activate the plugin I recive this message:
Fatal error: Call to undefined function bb_register_activation_hook() in /web/htdocs/www.example.com/wp-content/plugins/bb-attachments/bb-attachments.php on line 97
🙁
line 97 is:
bb_register_activation_hook(str_replace(array(str_replace(“/”,”\\”,BB_PLUGIN_DIR),str_replace(“/”,”\\”,BB_CORE_PLUGIN_DIR)),array(“user#”,”core#”),__FILE__), ‘bb_attachments_install’);
can someone help me?
Are you using the 1.0.2 version? Tell me more about your bbPress setup!
I made all according to procedure, but it does not work. I offer below to upload, but will choose when I will upload a file, the post is only text, not the attachments. I use bbPress version 1.0.2. 🙁 (translate by google translate O:-))
Must have missed something, it works fine.
I am getting error like denied mime for .txt and .doc etc..but i am able to upload images like .jpg..plz give me solution ASAP..
Thanks in advance…