Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Save File From ASP.NET

Posted on 2014-04-02
2
Medium Priority
?
298 Views
Last Modified: 2014-04-03
I want to give users a way to download files from my website.

How do I display a dialog like this?

Screen Snapshot
0
Comment
Question by:Ray Turner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
GowthamNatarajan earned 2000 total points
ID: 39974293
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
 

Author Closing Comment

by:Ray Turner
ID: 39974756
Thanks!   Exactly what I needed.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question