Hi experts,
I need a linkbutton/button to download the files which my clients have uploaded.
Below is my upload method and it works.
protected void uploadFile()
{
String projectID = (String)Session["projId"];
//change the file name
if (!FileUpload.FileName.Equals(""))
{
// Create a new folder in Docs folder (folder name = projectID)
System.IO.Directory.CreateDirectory(Server.MapPath("Docs/") + projectID);
// Save the file into the new folder.
FileUpload.PostedFile.SaveAs(Server.MapPath("Docs/" + projectID + "/" + FileUpload.FileName));
lblFile.Text = FileUpload.FileName + " is uploaded!";
lblFile.Visible = true;
}
}//end of method
However, it's not working for downloading of file (in another asp)
May I know how can I do that?
protected void btnLink_OnClientClick(object sender, EventArgs e)
{
String projectID = (String)Session["projId"];
String file1 = System.IO.Path.GetFileName(Server.MapPath("Docs/" + pid + "/"));
}
The files format that are uploaded are not consistent. Usually it's excel, word or pdf format.
Please help. Thanks!