1

I'm using Blueimp File Upload Plugin, to upload files to a remote server.

HTML:

<input id="fileupload" type="file" name="files[]" data-url="http://my-server-ip/upload.php" multiple>

JS:

$(function () {
    $('#fileupload').fileupload({
        dataType: 'json',
        done: function (e, data) {
            $.each(data.result.files, function (index, file) {
                $('<p/>').text(file.name).appendTo(document.body);
            });
        },
        paramName: 'files[]'
    });
});

So I try to upload a file, but I am always getting the following error: File upload aborted

As you can see, I tried to add the paramName: 'files[]' option like the answer on the following question: Jquery File Upload always fails with File Upload Aborted, And the folder's permission is 777.

4
  • What are you getting in $_FILES ? Commented Mar 1, 2016 at 8:33
  • @RayonDabre Array ( [files] => Array ( [name] => Array ( [0] => 1uploadMe.txt ) [type] => Array ( [0] => text/plain ) [tmp_name] => Array ( [0] => /tmp/phphJD9Lu ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 3 ) ) ) Commented Mar 1, 2016 at 8:37
  • It seems something is going wrong over server side... Commented Mar 1, 2016 at 9:26
  • @RayonDabre You were right, I checked the logs and I get move_uploaded_file(...): failed to open stream: Permission denied in ... although the folder's permission is 777. I run php5 and nginx on centos7. Any idea? Commented Mar 1, 2016 at 11:53

1 Answer 1

0

Perhaps late, but hopefully this will help anyone else that encounters the file abort error.

In my case, I was uploading huge video files...2-10GB each. After checking everything on the web about what was causing it, I found that the provided UploadHandler.php file didn't properly deal with file sizes beyond a 32-bit signed integer (2,147,483,647) - so, when it compared that result with the actual files size uploaded, it didn't match and triggered the error.

Additionally, there's intermittent use of comparison with integers and strings, so I just changed the code to use (float) for anything related to file size, and that fixed everything.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.