Solved

Download a file using asp.net

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

Accepted Solution

by:
paulmacd 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now