Media upload problem: Unexpected response from the server

Problem

You are trying to upload a media via your WordPress installation and you encounter this strange message:
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.

The message indicates an Unexpected response from your server… but your file may have been uploaded successfully. It advises you to check your media collection to see if your file has been uploaded successfully.

The cause

Several causes can create this error message. Here are some of them:

  • Setting PHP variables: unless you are dropping really big files, you can control your PHP variables regarding upload and post sizes (max upload size and max post size). We won’t go into detail about this procedure here, as it is already very common and may only affect a few files.
  • You have “mixed content” in your website (mixed-content): these are resources on your site that are uploaded in http and others in https.
  • You have installed a security plugin: some plugins, if incorrectly set or too restrictive, can cause interference with simple WordPress functions.
  • You are using a CDN and a limit causes this problem.

The solution

You will need to identify which of the three causes listed above causes you to display this message.

Concerning mixed content, you will have to identify if you have resources loaded in http and others in https. You can see this in a console when you are on a page of your website for example (F12 under Firefox / Chrome, CTRL + SHIFT + C under Opera). Example of an alert result :

If a security plugin is causing you concern, you need to see, or with an expert or your web provider, if it is well adjusted and the impacts of your plugin on the whole of your site. You can temporarily disable your security plugin and retry uploading your media to see if the message comes back. If not, the security plugin will actually be involved. The security of your website being a fundamental issue for your peace of mind and that of your visitors, it will be necessary to solve the problem by maintaining increased security on your site.

If you use a CDN, Content Delivery Network, or French content distribution network, consult the terms and conditions of the solution you are using. The objective of the CDN is to optimize the transmission of resources linked to your website. The main benefits are generally an improved user experience and a reduction in bandwidth costs. Depending on the offer you have, some have limitations to encourage you to migrate to a superior solution. It will therefore be up to you to act according to your needs for the resolution of your problem, in direct link with your web provider and the administrators of your CDN solution.

Still stuck ? You can contact an expert.

Leave a Comment

Your email address will not be published.

You may also like