D
deerchao
I used these codes to provide a default "Save As" filename for
browsers:
Response.AppendHeader("Content-Disposition",
"attachment; filename=" + fileName);
Response.ContentType = "application/octet-stream";
But if there are space chars in the file name, FireFox would split the
recommed file name, and use the first part only. For example, if
fileName=="aaa bbb.watever", then the "Save As" dialog will take "aaa"
as the filename.
And if there are more than one dots(char '.'), IE will add a "[1]"
before the first dot char. For example, if
fileName=="aaa.bbb.whatever", IE will show "aaa[1].bbb.whatever".
For some reason, I'd like to make these default file names exactly as
what I recommeded, Is there any way to do this?
Thanks!
Note: I tried UrlEncode and HtmlEncode the fileName in HTTP headers,
but none of them worked.
browsers:
Response.AppendHeader("Content-Disposition",
"attachment; filename=" + fileName);
Response.ContentType = "application/octet-stream";
But if there are space chars in the file name, FireFox would split the
recommed file name, and use the first part only. For example, if
fileName=="aaa bbb.watever", then the "Save As" dialog will take "aaa"
as the filename.
And if there are more than one dots(char '.'), IE will add a "[1]"
before the first dot char. For example, if
fileName=="aaa.bbb.whatever", IE will show "aaa[1].bbb.whatever".
For some reason, I'd like to make these default file names exactly as
what I recommeded, Is there any way to do this?
Thanks!
Note: I tried UrlEncode and HtmlEncode the fileName in HTTP headers,
but none of them worked.