Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have the following code and wonder if its wishful thinking on my part or if it is actually possible to send a blob in this manner

JavaScript
this.sendAudio = function() {

    var blob = event.clipboardData.items[0].getAsFile(),
    var uri = "http://localhost/TestWebService/UploadService.asmx?op=UploadFile";
    var xhr = new XMLHttpRequest();

    xhr.open("POST", uri, true);
    xhr.onreadystatechange = function() {
        if (xhr.readyState == 4 && xhr.status == 200) {
           // Handle response.
           alert(xhr.responseText); // handle response.
        }
    };
    xhr.send(blob);
  }
Posted
Comments
Sunasara Imdadhusen 22-May-14 5:33am    
Does this helpful or not http://art-of-fine-code.redbubble.com/blog/2014/02/12/html5-uploader/
Ignitius 22-May-14 6:33am    
the blob im trying to send is created in the browser and from my understanding stored in the cache, so that confused me even more

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900