Click to See Complete Forum and Search --> : Creating files on client


chrscote
04-06-2009, 12:55 PM
Does anyone know how to write an HTML file to a client's file system? I have an app in which the users will want to have HTML/XML files created on their own machines, but I'm not sure how to have a "Save As" box displayed for the user to input the folder to place the files.

Chris

Kuriyama
04-06-2009, 03:15 PM
You can't force a client to download a file, but you can create a file and prompt a save/open dialog box.

svidgen
04-06-2009, 03:54 PM
You just need to send the browser to a URL of a zipped version of the HTML/XML, to prevent the browser from rendering the content. The user will be prompted to open or save the file. Just make sure the user knows this is going to happen.

yamaharuss
04-08-2009, 11:12 AM
Or just have them save the target:

Here is your file!

To save the file to your computer right-click the link below and select "Save Target As" or "Save Link As".. blah blah

Click here