function upload(file){
var reader = new FileReader();
reader.onload = function (evt) {
uploadComplet(file.name, evt.target.result);
}
reader.readAsBinaryString(file.fileBlob);
}
function downloadComplet(binaryString){
var newFile = new File( [binaryString] , "newName.jpg");
var downloadUrl = URL.createObjectURL(newFile);
var downloadButton = document.createElement('a');
downloadButton.setAttribute('href', downloadUrl);
downloadButton.setAttribute('download', newFile.name);
downloadButton.setAttribute('class', 'button');
downloadButton.innerText = 'Download: ' + newFile.name;
downloadButton.click();
}
I uploaded the BinaryString of the image file and downloaded it as it was. But I could not bring in the correct image. What should I do?