Can you write files in Chrome 8?

Posted by greggory.hz on Stack Overflow See other posts from Stack Overflow or by greggory.hz
Published on 2010-12-25T20:32:27Z Indexed on 2010/12/25 20:53 UTC
Read the original article Hit count: 126

I'm wondering if, with the new File API exposed in Chrome (I'm not concerned with cross-browser support at this time), it would be possible to write back to files opened via a file input.

You can see an example of what I'm trying to accomplish here: http://www.grehz.com/ide.

I know I can use server side scripts to dynamically create the files and allow the user to download them normally. I'm hoping that there's a way to accomplish this purely client side. I had read somewhere that you can write to files opened via a file input. I haven't been able to find any examples of this, though I have seen passing references to a FileWriter class.

I would be completely not surprised if this wasn't possible though (it seems likely that there are security issues with this). Just looking for some guidance or resources.

UPDATE:

I was reading here: http://dev.w3.org/2009/dap/file-system/file-writer.html

As I was playing around in Chrome, it looks like FileSaver and FileWriter are not implemented, but BlobBuilder is. I can call getBlob() on the BB object, is there any way I can then save that without FileSave or FileWriter?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html5