LPology / Simple-Ajax-Uploader

Javascript file upload plugin with progress bar support. Works in all major browsers, including IE7+, Chrome, Firefox, Safari, and Opera. No dependencies - use it with or without jQuery.
995 stars 267 forks source link

A fix for the issue #50 #51

Closed hauru closed 8 years ago

hauru commented 10 years ago

Fixed the problem by adding the "appendFilenameToUrl" setting (true by default). Also, when the "data" object is empty "appendFilenameToUrl" is set to false , URL isn't modified at all. Now the uploader can be used for GAE apps under XHR-capable browsers (haven't yet tested it with older ones).

LPology commented 10 years ago

I'm fairly certain that this will break the plugin in HTML5 browsers when using the included PHP class.

The issue is that additional fields can't be added to binary stream uploads (the default behavior in browsers with File API support). That's why the file name is appended to the URL -- it's the only way to transmit the file name to the server.

I do believe this issue can be fixed, though. It's going to take some additional changes. I'll be working on it.

hauru commented 10 years ago

When you leave the "appendFilenameToUrl" option set to true (the default), plugin's behaviour should basically remain unchanged. And when it's set to false, the extra params are still appended to the URL. I'm not sure how it can break things. There should be no problems with the PHP class as long as "appendFilenameToUrl" remains true... or perhaps i've missed something.

BTW, plugin works great here. Thanks for your work.