http error when uploading files
-
Hi there, thanks for picking up the development of this plugin. I’m just having a look at buddypress and buddy drive for the first time as I need a file sharing platform for a certain group of people. I’m having a problem when I try to upload a file:
- I get a ‘http erro’ message (note that the site is on https).
- The upload boxes show a bar but they don’t show the file name or any indication of what it being uploaded (possibly to do with the error.
I’m using Kadence theme on wp 6.8.12 and php 8.2
Thanks,
Adam
-
Hi @ac1643, thanks for the report and for the details.
I set up a site close to yours (WordPress 6.8.12, PHP 8.2, Kadence, BuddyPress 14.5 and BuddyDrive 2.1.5) and found a bug that stops the BuddyDrive app from loading in the member’s profile tab. I’m working on a fix and will post here when the update is out.
I couldn’t reproduce the “HTTP error” itself yet: uploads from the BuddyDrive menu in the dashboard work on my test site. That message means the server answered the upload request with an error, so a few details would help me find it:
- Where are you uploading from: the BuddyDrive tab in your profile, a group, or the BuddyDrive screen in the dashboard?
- What type and size is the file? Does a small .txt or .jpg file fail too?
- Does the same file upload fine through Media > Add New?
- If you can, open the browser’s developer tools (Network tab), try the upload again and tell me the status code of the
admin-ajax.phprequest (for example 403, 413 or 500). - Any lines in your PHP error log around the time of the upload.
With that I should be able to tell whether it’s BuddyDrive or a server limit (upload size, firewall) blocking the request.
Let me know!
Hi @ac1643, BuddyDrive 2.1.6 is out with a fix for the BuddyDrive tab in the member profile, which stayed empty with classic themes like Kadence.
Please update and try the upload again.
If you still get the “HTTP error” after the update, the details I asked for above (where you upload from, the file type and size, whether it uploads through Media > Add New, the status code of the
admin-ajax.phprequest and your PHP error log) will help me find what is blocking it.Hi thanks for the quick response and looking into this. Some more details:
- I still see the http error after updating the plugin.
- Tried loading from all areas and always get the http error
- I was trying to upload a pdf file. I get the same problem with a .txt file
- status of admin-ajax is 500
Thanks @ac1643, that helps. A 500 on admin-ajax.php for every file, even a small .txt, means PHP is stopping with a fatal error while it handles the upload. I can’t reproduce it on my test sites with BuddyDrive 2.1.6 and PHP 8.2, so I need the error message itself to see where it comes from.
WordPress never shows that message in the upload response (you only get “There has been a critical error on this website”), but it can write it to a log file. Could you turn on debug logging by adding these lines to wp-config.php, above the line that says “That’s all, stop editing!”:
define( 'WP_DEBUG', true );define( 'WP_DEBUG_LOG', true );define( 'WP_DEBUG_DISPLAY', false );Then try the upload once more and paste here the “PHP Fatal error” line from wp-content/debug.log, with the few “#0, #1…” lines below it (you can remove the site path if you like). Remember to remove those lines afterwards.
Two more quick questions:
- Does uploading the same file through Media > Add New in the dashboard work?
- Which other plugins are active? If you can, try the upload with only BuddyPress and BuddyDrive active (the Health Check & Troubleshooting plugin can do this just for you, without affecting visitors) to rule out a conflict.
- Uploading through media > add new works fine.
- I’ve deactivated most other plugins to help check this. I will try today with only BP and BD active.
These are the first few debug errors:
[17-Nov-2026 08:31:58 UTC] PHP Deprecated: Creation of dynamic property BuddyDrive_Screens::$template is deprecated in /wp-content/plugins/buddydrive/includes/buddydrive-item-screens.php on line 57
[17-Nov-2026 08:31:58 UTC] PHP Deprecated: Creation of dynamic property BuddyDrive_Screens::$current_screen is deprecated in /wp-content/plugins/buddydrive/includes/buddydrive-item-screens.php on line 58
[17-Nov-2026 08:31:58 UTC] PHP Deprecated: Creation of dynamic property BuddyDrive_Screens::$is_bp_default is deprecated in /wp-content/plugins/buddydrive/includes/buddydrive-item-screens.php on line 61
[17-Nov-2026 08:31:58 UTC] PHP Deprecated: Creation of dynamic property BuddyDrive_Screens::$template_dir is deprecated in /wp-content/plugins/buddydrive/includes/buddydrive-item-screens.php on line 64
[17-Nov-2026 08:31:58 UTC] PHP Deprecated: Creation of dynamic property BuddyDrive_Attachment::$action is deprecated in /wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment.php on line 77Thanks @ac1643, that’s useful.
Media > Add New working tells me the server accepts uploads in general, so it’s something specific to the BuddyDrive upload request.
The lines you pasted are “Deprecated” notices. They’re harmless (PHP 8.2 writes them on every page load, I’ll clean them up in a future update) and they’re not what stops the upload. The useful line is further down, written right when the upload fails. Could you try the upload once more and then search debug.log for “Fatal”? If you find it, please paste that line and the few “#0, #1…” lines below it.
If there is no “Fatal” line at all, then the 500 doesn’t come from WordPress but from the server before WordPress even runs, usually a security firewall (like ModSecurity) blocking the request to admin-ajax.php. In that case your host can check their server error log for the time of the upload and tell you which rule blocked it.
ok here we are, one displayed warning and a php fatal error in the debug file:
Warning: Cannot modify header information – headers already sent by (output started at /website/wp-content/plugins/buddydrive/includes/buddydrive-item-classes.php:977) in /website/wp-includes/functions.php on line 7168
PHP Fatal error: Uncaught Error: Call to undefined function transliterator_transliterate() in /website/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment.php:304
Stack trace:
0 website/wp-includes/class-wp-hook.php(326): BP_Attachment->sanitize_utf8_filename()
1 website/wp-includes/plugin.php(205): WP_Hook->apply_filters()
2 website/wp-includes/formatting.php(2081): apply_filters()
3 website/wp-includes/functions.php(2555): sanitize_file_name()
4 website/wp-admin/includes/file.php(984): wp_unique_filename()
5 website/wp-admin/includes/file.php(1105): _wp_handle_upload()
6 website/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment.php(276): wp_handle_upload()
7 website/wp-content/plugins/buddydrive/includes/buddydrive-item-functions.php(452): BP_Attachment->upload()
8 website/wp-content/plugins/buddydrive/includes/buddydrive-item-ajax.php(57): buddydrive_upload_item()
9 website/wp-includes/class-wp-hook.php(324): buddydrive_upload_file()
10 /website/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
11 /website/wp-includes/plugin.php(517): WP_Hook->do_action()
12 /website/wp-admin/admin-ajax.php(192): do_action() 13 {main}thrown in /website/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment.php on line 304
Thanks @ac1643, that’s exactly the line I needed.
The error comes from BuddyPress, not BuddyDrive. BuddyPress 14.5.0 to 14.5.4 has a bug in the function that cleans up file names during an upload (
BP_Attachment::sanitize_utf8_filename()): on servers without the PHPintlextension it still callstransliterator_transliterate(), which only exists whenintlis installed, so PHP stops with a fatal error. Every upload that goes through BuddyPress fails this way, including BuddyDrive and BuddyPress’ own profile photo and cover image uploads. Media > Add New doesn’t use that code, which is why it works.I reproduced it on my test site by turning
intloff: with BuddyPress 14.5.4 the upload fails with the same fatal error, and with 14.5.6 it works. BuddyPress fixed it in 14.5.6, released on November 17. Please update BuddyPress and try the upload again. Asking your host to enable the PHPintlextension also avoids it, and is worth doing anyway.The “Cannot modify header information” warning is only a side effect of PHP notices being printed while debugging, so you can ignore it. Once the upload works, remember to remove the debug lines from wp-config.php.
Brilliant, thanks for your efforts with this, I’ve updated BP and its now uploading files without the http error.
You must be logged in to reply to this topic.