Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WordPress: Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page

Does anyone know what this error message on WordPress means?

Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.

I couldn't find any errors that I can think of.

This happened when I tried to upload an MP4 file that is about 200MB in size. I have set my WordPress to accept MP4 of up to 5GB so that shouldn't be a problem, I am using WordPress Multisite installation on Ubuntu 16.04.

In my php.ini I have set the max upload size to 50GB and max post size to 50GB too and I also set the max memory to 1GB. But it just kept sending me that error and I have no idea where to look. All it says was an unexpected response and I have no idea what response that might be.

I can upload MP4 with a size of 27MB with no problem, I know the default WordPress setting is 20MB so I'm pretty sure the size isn't the problem.

I have also check that the file wasn't corrupted, it was working fine on my computer as well as YouTube.

I tried restarting PHP (PHP-FPM) and Apache2 but it doesn't seem to be working.

Does anyone has an idea of what is going on? Thanks 🙌

like image 917
Anthony Kung Avatar asked Jan 26 '20 04:01

Anthony Kung


1 Answers

I think my answer is too late. but I would like to post a solution for anyone still looking for a solution for this issue on WordPress running on Nginx. You should add the following directive to set the maximum allowed size in HTTP(server/location) section.

client_max_body_size 10M;
like image 82
Elias Diek Avatar answered Nov 07 '22 16:11

Elias Diek