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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.