G
ghighi
Hello, Il a downloading a file from a download.aspx page with that
code:
-----------------------------------------------------------------------------------------
string fileName = Request.Params["file"];
string fileExtension=fileName.Substring(fileName.Length-3);
string filePath = Path.Combine( "apath",fileName);
FileStream fs = new FileStream(filePath,
FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
Response.AddHeader("Content-Disposition", "attachment;
filename="+System.Web.HttpUtility.UrlEncode(fileName));
Response.WriteFile(fs.Handle,0,fs.Length);
fs.Close();
Response.Flush();
---------------------------------------------------------------------------------
This code opens a "save as" window in witch I can select the path where
to save my file, change the file name and select the file extention
The default file type selected is "html document" while I would like it
to be "any file *.*"
What can I do in my code so that my "save as" widows is opened with the
"*.*" file type selected?
Thanks for any help,
G.
code:
-----------------------------------------------------------------------------------------
string fileName = Request.Params["file"];
string fileExtension=fileName.Substring(fileName.Length-3);
string filePath = Path.Combine( "apath",fileName);
FileStream fs = new FileStream(filePath,
FileMode.Open,FileAccess.Read,FileShare.ReadWrite);
Response.AddHeader("Content-Disposition", "attachment;
filename="+System.Web.HttpUtility.UrlEncode(fileName));
Response.WriteFile(fs.Handle,0,fs.Length);
fs.Close();
Response.Flush();
---------------------------------------------------------------------------------
This code opens a "save as" window in witch I can select the path where
to save my file, change the file name and select the file extention
The default file type selected is "html document" while I would like it
to be "any file *.*"
What can I do in my code so that my "save as" widows is opened with the
"*.*" file type selected?
Thanks for any help,
G.