0

I have a code:

var FReader = new FileReader();
FReader.onload = function(evnt){
  console.log(evnt.target.result);
  //How can I convert `evnt.target.result` back into a file and save it?
}

FReader.readAsBinaryString(file);

Please do not offer me to use other methods. This is a very simplified code. In the original code this data is passed to other people via websockets. And I need to transform it into files.

How can I convert evnt.target.result back into a file and save it?

Jacob Tomlinson
  • 3,341
  • 2
  • 31
  • 62
Vitalii Maslianok
  • 1,601
  • 1
  • 14
  • 16
  • You can submit this to the server and in turn give the response as a file back from the server – AmGates Mar 13 '13 at 10:45
  • Similar to http://stackoverflow.com/questions/4485182/force-download-for-blob-created-with-filewriter-in-javascript – igoratron Mar 13 '13 at 11:59
  • There is an API to have Save As dialog opened for a Blob, but I cannot remember it out of my head. http://updates.html5rocks.com/2011/08/Saving-generated-files-on-the-client-side – Mikko Ohtamaa Mar 14 '13 at 10:48

0 Answers0