Search code examples
javascriptjqueryfile-uploadjquery-file-upload

jQuery fileupload url with query params


The endpoint I'm uploading a file to requires a query parameter: ?name=foo.txt. However, when using the fileupload plugin for jQuery, it strips any parameters out of the url when I set it like this:

$('#file-input').fileupload({url: '/upload?name=foo.txt'});

When I check the value of url it returns /upload. I can't find anywhere in the documentation that allows you to set query parameters. Any help would be greatly appreciated!


Solution

  • Turns out that it actually is possible to do this. I had problems elsewhere in my code.