4 stars based on
The responseType property of the XMLHttpRequest object can be set to change the expected response type from the server. Possible values are the empty string default"arraybuffer""blob""document""json"and "text". This is null if the request is not complete or was not successful.
The valid range for x is from 0 to filestream. See also downloading files. The following example sends creates a text file on-the-fly and uses the POST method to send the "file" to the server. This example uses plain text, but you can imagine the data being a binary file instead. This is building a byte array of 8-bit integers and sending it; you can use any binary data you'd like, of course.
Document Tags and Contributors Tags: Contributors to this page: Learn the best of web development Get the latest and greatest from MDN delivered straight to your inbox.