This Firefox extension listens for a "WriteFile" event from an element in a web page and writes the contents of that element to the path given in the "filename" attribute of the same element. In the interest of system security, this extension will not overwrite existing files.
See the example here: Github gist
- Building an Extension
- Interaction between priviledged and non-priviledged pages
- XPCOM File I/O
- XPCOM nsIFile
- XPCOM nsILocalFile
- XPCOM PR_Open - includes file open flags definitions