I am trying to figure out a way to download a file onto the users
computer from an ASP.NET webpage and then open that file
automatically.

I'm using the code shown below to download the file.  This also give
the option to open the file, but it opens it in the browser -- not the
user's hard drive.

How can I open the file that was download to the user's hard drive?

Response.ContentType = "application/vnd.ms-excel"
Response.ContentType = "application/x-msdownload"
Response.AddHeader("Content-Length", fileInfo.Length.ToString)
Response.WriteFile(filePath)
Response.End()

Reply via email to