Downloading generated files

  • Thread starter Thread starter Paulo
  • Start date Start date
P

Paulo

Hi, the system generates a text file on a server folder called "remessa",
how do I do to user downloads the generated file to his machine?

VS 2005 asp.net C# 2.0

Thanks
 
If you want to stream the file down, do the following code. Otherwise, just
give them a link to the generated file.


Response.ClearContent()
Response.AddHeader("content-disposition", "attachment;
filename=remessa.txt")
Response.ContentType = "text/html"

Response.Write("Your file text here")

Response.End()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top