0

<script>
const value = ('; '+document.cookie).split(`; theuname=`).pop().split(';')[0];
document.getElementById('mefile').href = value;
document.getElementById('output').src = value;

var xhr = new XMLHttpRequest();
xhr.open('GET', value, true);
xhr.responseType = 'blob';
xhr.onload = function(e) {
  if (this.status == 200) {
    var myBlob = this.response;
    // myBlob is now the blob that the object URL pointed to.
    
    console.log(myBlob);
    

  }
};
xhr.send();


</script>

Using the script above, I am able to generate both blob url and blob object itself from a cookie value from the domain. Now what I need to do is to upload this blob object to a server using php. I have read a lot of similar questions on stackoverflow, github and google but none of them is able to do what I want. What I need is to submit the blob object like an object from input file. Thanks for your help.

chiefdakwa
  • 23
  • 4

0 Answers0