Generate file in memory to save to local disk

Please support our ASP.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: May 2005
Posts: 2
Reputation: RussGreen is an unknown quantity at this point 
Solved Threads: 0
RussGreen RussGreen is offline Offline
Newbie Poster

Generate file in memory to save to local disk

 
0
  #1
May 19th, 2005
I need help writing a method to create a simple text file. I want that file to be saved to a local drive (client side of my asp.net app). The filename will always be the same "license.txt" but the content will be different for each user. I don't really want to create the file on my server and them have them downloaded it. I would much rather use a stringbuilder and the save the contents of the stringbuilder to the users local drive (propted of course).

TIA

Russ
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Generate file in memory to save to local disk

 
0
  #2
May 19th, 2005
That would violate the browser security model. Browsers are not supposed to author files on a user's system.

The exception that has been provided is the cookie mechanism.

Even if you use StringBuilder to build a "file"... what are you going to do with it? You have to render something to the Response stream. I would suggest you write it into a DIV. Let the user select it and save it if they wish.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC