Hi. Thanks for your reply.
I'm trying to download files. By the way, I'm using C# so doesn't really quite understand the VB code.
I tried this .
protected void btnLink_OnClientClick(object sender, EventArgs e)
{
String pid = Convert.ToString(Session["pid"]);
String file = System.IO.Path.GetFileName(Server.MapPath("Docs/" + pid + "/EP/"));
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file);
Response.End();
}
But it doesn't work .
Error msg : Access to the path 'C:\Documents and Settings\[machineName]\My Documents\[projectName]' is denied.
Is it because I upload at my documents?
What should I do? Please help. Thanks
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Offline 53 posts
since Nov 2007