I just upgraded to the new jQuery (I think I had 1.7, now 1.10.2), which broke the BlueImp File Upload, so I updated the blueImp files.
I am having trouble tracking down a bug I am getting. When I upload a file, it sends an invalid JSON file:
{"files":
[{"name":"jpg.jpg","size":8483,"type":"image\/jpeg","url":"orderfiles\/139\/jpg.jpg","delete_url":"\\/public_html\/uploader\/139\/?file=jpg.jpg","delete_type":"DELETE"}]}
{"files":
[{"name":"jpg (1).jpg","size":0,"type":"image\/jpeg","error":"abort","delete_url":"\\/public_html\/uploader\/139\/?file=jpg%20%281%29.jpg","delete_type":"DELETE"}]}
Which is duplicate with the second entry being empty. The file gets uploaded.
SyntaxError: Unexpected token {
My code is more or less copied from the source with slight modifications
$('#fileupload').fileupload('option', {
maxFileSize: 50000000,
autoUpload: true,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|psd|ai|pdf)$/i,
process: [
{
action: 'load',
fileTypes: /^image\/(gif|jpeg|png|psd|ai|pdf)$/,
maxFileSize: 50000000 // 50MB
},
{
action: 'save'
}
]
});
Any insight as to why it would be duplicating the JSON data (with the second entry empty)? I can post more parts of code, I'm just not sure which ones are relevant!