Use a more suitable content type for file uploads

application/x-www-form-urlencoded;charset=UTF-8 is the default, which shinyapps.io
cares about for some reason and tries to parse the data as such. By setting the
content type to the more accurate application/octet-stream, no middleware should
be tempted to futz with the contents.
This commit is contained in:
Joe Cheng
2017-07-07 16:19:16 -07:00
parent ea407fb2ea
commit 2d40e7b51a
5 changed files with 5 additions and 3 deletions

View File

@@ -107,6 +107,7 @@ $.extend(FileUploader.prototype, FileProcessor.prototype);
return xhrVal;
},
data: file,
contentType: 'application/octet-stream',
processData: false,
success: function() {
self.progressBytes += file.size;