JPG Images with height >= 1200 failing to upload

23 views
Skip to first unread message

David Riley

unread,
May 1, 2015, 11:32:58 AM5/1/15
to jquery-f...@googlegroups.com
I'm finding that some image files fail to upload. It seems to affect JPG files with height at least 1200 pixels. I haven't tested enough files to be sure of that, but all the ones I've tried with that height have failed and all the ones less than that height have succeeded.

I get the same issue in both chrome and iceweasel on Debian testing.

An example of a file that fails is at: http://gate.undef.org.uk/tmp/test6.jpg
And another one that I googled in case the issue was in my image editor: http://wvs.topleftpixel.com/photos/stiched_eaton_center_tall_2.jpg

Those files fail on the demo page (https://blueimp.github.io/jQuery-File-Upload/) with "File type not allowed". That's because they're given a header like: Content-Disposition: attachment; filename="test6." i.e. with the file extension missing.

That comes from this code in jquery.fileupload.js:

            if (!multipart || options.blob || !this._isInstanceOf('File', file)) {
                options.headers['Content-Disposition'] = 'attachment; filename="' +
                    encodeURI(file.name) + '"';
            }

It's the isInstanceOf('File', file) that makes it go into that block, which doesn't happen for other files. The browser debugger shows it's a Blob instead of a File.

I can work around this in that code block by adding 'jpg' onto file.name if it ends with a dot, but I haven't been able to find the root cause.


Reply all
Reply to author
Forward
0 new messages