Click here to Skip to main content
15,746,107 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:

I am developing a project where, the user can upload and download the files. I completed the upload option and displayed the file name which is uploaded to the server.

Now, if user need those files, then he can able to download the selected file (which is uploaded recently). I don't know how to download those files and its contents.
I need to put a download link, it is possible to download those files in

Could anybody help me plz?

Downloading files themselves is simple: just put a link to the file on the web page.
If you have stored them in a database, or a zip it's slightly more complex - but not a lot.

But if they are there as files, a link is all you need.
Share this answer
raju melveetilpurayil 12-Dec-11 4:41am    
+5 well said.
if you are having a file in folder trhen try using simple link as:
<a href="../../Content/ExamPapers/Question.txt" target="_blank">Paper1</a>
Share this answer
Share this answer
Please follow the below link to "Downloading a File with a Save As Dialog in ASP.NET"
Share this answer
How to Download files using

in code
Share this answer
You can simply bind the link dynamically with <a href="&lt;%#location/DataBinder.Eval(Container.DataItem, "FileName")%&gt;">Download</a>
and While you click on the DownLoad

Associated file will be downloaded
Share this answer
[no name] 12-Dec-11 5:27am    
Thanks for u r reply !!


Here location means saving file location or what? Can u Explain about that syntax? what exactly we can write there?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900