I am developing a website where I am uploading document and stored in folder. Uploading document works fine but download code not works. I need to download file from folder.
protected void btnDownload_Click(object sender, EventArgs e)
{
lblresume.Text = "~/Student_Resume/" + fuResume.FileName.ToString();
if (lblresume.Text != string.Empty)
{
string filePath = lblresume.Text;
Response.ContentType = "doc/docx";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath(filePath));
Response.End();
}
}