w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to upload file NOT using multipart encoding? (maybe use octect or something)

It's quite simple to do this, simply pass the blob/file as the parameter to your call to the send method on your XHR instance, for example:

function uploadFile(blobOrFile) {
    var xhr = new XMLHttpRequest();
    xhr.open("POST", "http://mydomain.com/upload", true);
    xhr.send(blobOrFile);
}

Note that this will only work in File API browsers, (i.e. not IE9 and older)





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.