title: Is it possible to save a file directly from a web worker?
body: <p>I have an entirely browser-based (i.e. no backend) application which analyzes XML data in files which average about 250MB each. The actual parsing and analysis happens in a web worker, which is fed data in 64KB chunks by a <code>FileReader</code> instance, and this is all quite performant.</p>
  
  <p>I have a request from the client to expand this application so that it can generate a .zip file containing the original input file and the results of the analysis, and allow the user to save that file to her local machine. Generating a .zip file in memory with those contents isn't a problem. The problem lies in transferring that much data from the web worker which generates it back to the main browser thread, so that it can be saved; attempting to do this invariably provokes a crash or out-of-memory exception. (I've tried transferring strings all at once and a chunk at a time, and I've tried using an <code>ArrayBuffer</code> as a transferable object to avoid copying. All fail in the same fashion.)</p>
  
  <p>Unfortunately, I don't know any way to invoke a file save operation directly from a worker thread. I know several methods of doing so from the main browser thread, but all of them require either the ability to create DOM nodes (which worker threads of course can't do), or the use of interfaces (i.e. msSaveBlob, saveAs) which no browser seems to expose to a worker thread. I've spent a while looking for possibilities on the web, but found nothing usable; <code>FileWriterSync</code> looked good, but only Chrome supports it, and I need to target IE and Firefox as well.</p>
  
  <p>Is there a method I've overlooked for saving files directly from a web worker? If so, what is it? Or am I just out of luck here?</p>