PHP Problem with UPLOAD_ERR_PARTIAL (File upload error code 3)

I have just spent the last 3 hours trying to figure out why only ever 3rd file would upload (and then files would only randomly upload) and i continued to getĀ UPLOAD_ERR_PARTIAL. It turns outĀ UPLOAD_ERR_PARTIAL can be caused by the header Connection: Keep-Alive.

If you are working on a web app that requires a lot of file uploading, make sure to use on your uploader script to set:
header("Connection: close");

This will force the connection to be closed, and for a new connection to be opened to upload the file, which allows the file to be properly uploaded.

Comments

Pingback from UPLOAD_ERR_PARTIAL when uploading from iOS to PHP backend | BlogoSfera
Time April 11, 2013 at 4:03 am

[...] some research and it seems these errors can be caused by issues with headers, e.g. Keep-Alive (see http://www.bizzeh.com/739/php-problem-with-upload_err_partial-file-upload-error-code-3). It’s suggested that setting header("Connection: close"); could solve the [...]

Pingback from UPLOAD_ERR_PARTIAL when uploading from iOS to PHP backend – How-To Video
Time April 11, 2013 at 4:23 am

[...] some research and it seems these errors can be caused by issues with headers, e.g. Keep-Alive (see http://www.bizzeh.com/739/php-problem…. It’s suggested that setting header("Connection: close"); could solve the issue.The thing [...]

Write a comment