Processdata:false
This is a parameter of Jquery.ajax. The default value is true, which means that non-string objects are automatically converted to K1=v1&k2=v2 form, such as an array parameter {d:[1,2]}, which becomes d[]=1&d[]=2 after the server.
To set it to false to upload the Arraybuffer object, the server gets the raw byte stream directly from the Request.inputstream.
W3school Explanation:
true " application/x-www-form-urlencoded " false.
Main code: (the following code is called in the Readasarraybuffer completion event onload of the FileReader async method, this points to the current reader)
$.ajax ('/home/file ', { this. result, ' POST ', false , function (res) { console.log (res); }, function (err) { console.log (err); } });
The server accepts the file class content:
var stream = Request.inputstream;
Because only HTML5 have FileReader object, so only HTML5 support JS original zoning block upload file.
The previous article uses the WebSocket original zoning block to upload files in a way that only supports HTML5.
Because the http1.1 default Keep-live property, the connection is not re-established each time it is requested. Therefore, the server can not use the WebSocket scenario, but the client is supported by the HTML5 case, the Ajax original zoning block upload.
Html5+ajax the key parameter setting of the original zoning block upload file