Solved

Download a file using asp.net

Posted on 2014-11-18
1
205 Views
Last Modified: 2014-11-26
Hi there,
I'm using Visual Studio 2008. Im have a web form that creates a file to a sub directory:
Dim path As String = HttpContext.Current.Request.PhysicalApplicationPath.ToString() + "Files\" + source + "_" + Format(Gldate, "MMddyyyy") + ".txt"
once this file gets created i need to have a way for the user to download it. After i did a quick search online i found that a Generic Handler can be an option but haven't use it before and wont know how to call it =(
Can you point me to the right direction?
Thanks!
0
Comment
Question by:COHFL
1 Comment
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points
ID: 40450222
There are a couple ways you can do this.  
  1) Create a link to the new file and let the user click it to open/download the file.
  2) RESPONSE.REDIRECT to the file, forcing the browser to follow the link.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 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