Saturday, December 25, 2010

Can you write files in Chrome 8?

Programmer Question

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?



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails