Search code examples
jqueryjquery-file-upload

jQuery File Upload JSON error on multiple drag and drop


I have managed to finally get Blueimp's jQuery File Upload working apart from one thing, if files are added to the list by dragging and dropping one at a time everything works great. If I select multiple files and drag and drop them all at the same time, they are all shown in the list along with their file sizes but the upload and cancel buttons only appear by the first in the list. If inspect that part of the page the <td></td> has been created for the buttons but it is empty.

The same behaviour happens if I click the button to browse to add and try to add multiple selected files in one go.

if I click upload (either the download button next to the top file or the upload all button) they seem to upload ok, the progress bars move correctly but then I get the error SyntaxError: Unexpected end of JSON input next to all the files although the first file in the list does actually upload.

This function is very complex (or should I say it is to me) and to be honest I haven't got a clue which part or even which file is responsible for the failure for me to upload my code but I'd wondered if anyone else had this issue or could point me in the right direction to start looking.


Solution

  • I replaced the jquery.fileupload.js with the original version from the original download and now it works. I'd obviously tinkered with it somewhere along the line and something I'd done had affected it.