Solved

Download a file using asp.net

Posted on 2014-11-18
1
210 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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