fongjeffrey
May 26th, 2005, 04:30 AM
Hi there,
I am having problem to show the File Dialog for downloading a file from the server. I need to display a file dialog, so that the user can select where he/she wants to save the file. The followings are the code that on my download.aspx file. "path" is the complete path of the file being downloaded.
string path = (string)Request.QueryString["File"];
System.IO.FileInfo file = new System.IO.FileInfo(path);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.Flush();
Response.Write(file.FullName);
Response.End();
I don't know what's wrong with my code. Could anyone tell me how to chnage my code and the file dialog can be displayed for selecting the store location?
Any help will be appreicated! Thank you very much
Jeffrey
I am having problem to show the File Dialog for downloading a file from the server. I need to display a file dialog, so that the user can select where he/she wants to save the file. The followings are the code that on my download.aspx file. "path" is the complete path of the file being downloaded.
string path = (string)Request.QueryString["File"];
System.IO.FileInfo file = new System.IO.FileInfo(path);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.Flush();
Response.Write(file.FullName);
Response.End();
I don't know what's wrong with my code. Could anyone tell me how to chnage my code and the file dialog can be displayed for selecting the store location?
Any help will be appreicated! Thank you very much
Jeffrey