Click here to Skip to main content
15,306,142 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
how to upload a document and download a document in asp.net........
i need to know the coding in c#......
Thank you......
Posted

1 solution

Downloading:

Without programming, if you have an anchor in HTML code with href pointing to document's URI, you can simply use content menu item "Save As":
HTML
<a href="myDocument.pdf">Download document</a>


If the use clicks the link, it might be just loaded as a page, depending of file type.
This is how you can enforce downloading with "Save As" dialog using Content-disposition:
http://support.microsoft.com/kb/260519[^].

Uploading:

To upload a file, you just need a Web form with method "POST", but to process the upload you need some server-side coding.
This is the detailed ASP.NET tutorial: http://www.asp.net/data-access/tutorials/uploading-files-cs[^].
This CodeProject article provides very clear and simple explanation: File Upload with ASP.NET[^].

—SA
   
v3

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