Failed media upload: “The uploaded file was only partially uploaded.”

I am running Linux CentOS 5.8 and I have my web pages using WordPress 4.0.

I am trying to uplad jpg photos to server via WordPress, but it randomly fails. I uploaded few photos, and then I get errors like:

“4.JPG” has failed to upload due to an error
The uploaded file was only partially uploaded.

Then I try again and again and again until it is successfuly uploaded. Very frustrating.

How can I debug this? Is there a log file? Where to look for?

Solutions Collecting From Web of "Failed media upload: “The uploaded file was only partially uploaded.”"

I ran into the same problem and tried doing a google search and came up with so many technical suggestions that I could not begin to even start as I’m not tech savvy. I did run into an article where a blogger said she contacted her hosting server and they changed the PHP version. It may or may not work for me but I was going to try.

Only I didn’t know how to do that and I just got off with customer support and basically what he did was increase my bandwidth. I still couldn’t upload. I did tell him in the add media library page it did say max upload file size was 2MB. But it wasn’t until I refresh the page that the change kicked in and I saw my maximum upload file size was 256 MB. After that I was able to upload photos just fine!

I managed to resolve this problem with changing Apache server configuration: there is a KeepAlive flag which needs to be turned Off.

More about this flag:

Apache Optimization: KeepAlive On or Off?

I solved this, by removing libapache2-mod-php5filter:

apt-get remove libapache2-mod-php5filter

and installing libapache2-mod-php5:

apt-get install libapache2-mod-php5

I solved it by adding

<?php header ("Connection: close"); ?> 

in file.php situated under wp-admin/include