|
I need to have the user click on a link, File Save As dialog box pops up, user then saves the contents of a variable into memory. Please help.
|
|
|
Off the top of my head, here are my thoughts.
One way is to use client-side VBScript and use the filesystem object to create a file and write the variable contents into the file. This is actually pretty easy to do. However, most people`s computers will be configured to block that kind of activity. (Imagine any generic website being allowed to write any kind of files to your hard drive!) If the application is only run by a controlled user base, then you may get away with it by having them specifically set your site to a Trusted site and allow script processing.
A second way would be to have the page submit back to an ASP script on your server that saves the variable contents into a text file on your server, then serve that file back to the user via an HTML page with a link to download it. (You`ll need to add a note to tell your users to right-click and choose Save As. Otherwise, the browser will just open the text file.) Unless--you want to get fancier and force the page as a file stream--which can be done.
Either way, I think you`ll end up needing to send the variable contents back to your server, create a file there, then send that file to the client. Maybe someone will reply with a better method.
|
|
|
|
|
|
|
|
|
|