• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 301
  • Last Modified:

Save File From ASP.NET

I want to give users a way to download files from my website.

How do I display a dialog like this?

Screen Snapshot
0
Ray Turner
Asked:
Ray Turner
1 Solution
 
GowthamNatarajanCommented:
Try this....        


string fileName = "test.xls";
        string filePath = Server.MapPath("~/test.xls");
        Response.Clear();

        Response.AppendHeader("content-disposition", "attachment; filename=" + fileName);
        Response.ContentType = "application/octet-stream";
        Response.WriteFile(filePath);
        Response.Flush();
        Response.End();
0
 
Ray TurnerSenior ConsultantAuthor Commented:
Thanks!   Exactly what I needed.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now