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

Upload URL always gets modified #50

Closed hauru closed 9 years ago

hauru commented 10 years ago

Target URL always gets modified before the file upload. Even if there are no extra params specified, the file name is appended to the query string. This is problematic for platforms where an exact URL must be used - such as Google AppEngine. For GAE even appending "?" alone can cause problems.

I suggest adding a setting that would guarantee the URL to remain completely untouched.

Thanks.

LPology commented 10 years ago

Thanks for bringing this up about GAE. I wasn't aware of how that may create an issue until now.

The reason that the file name is appended to the URL is that binary stream uploads don't allow additional fields to be added to the upload. Without modifying the URL, only multipart form uploads can be used.

Your point is well taken, however, so I'm going to work on adding this as an option. The way it will work is by only uploading using the multipart form method, which allows the file name to be sent to the server without modifying the URL.

Thanks for bringing this up. Very insightful observation.

dannycallaghan commented 9 years ago

Hello. Has this been fixed by any chance? Really want to use your solution, we can't accept any params added to our URL.

LPology commented 9 years ago

@dannycallaghan Just pushed an update that adds a new noParams option. The default value is false to match previous behavior.

To use an unaltered URL, set the noParams option to true and the value of the url option will be used without any modification.