Click here to Skip to main content
15,921,694 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys.
i am working on an asp.net page which show resume .now i want the user,to be able to download that resume.resume is saved in both database and a folder named jobseeker on server .
how should i do it .
thank you all in advance friends
Posted

File Upload and Download in ASP.NET[^]

Hope this can help you.
 
Share this answer
 
Hi,
Create an ASPX file, called download.aspx. This file takes a file name as a parameter, and returns the contents of that file in the response stream.In your case the resume itself. On downanload.aspx.cs Page_Load event use this code below
MIDL
Response.ContentType = "application/msword";
Response.AppendHeader("Content-Disposition","attachment; filename=resume.doc");
//Convert virrual path of requested file to physical path
Response.TransmitFile( Server.MapPath("~/resume/1.doc") );
Response.End();

This will prompt user to download the requested file.The ContentType header which is added, sets your MIME type so that the browser knows what kind of file this is.For example, if you are serving an MS Word file for resume, this would be "application/msword". Octet-stream. You will get list of different Content Type here[^]

Hope this will help.
 
Share this answer
 

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