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()
 
Back
Top