wolfgang wagner wrote:
Carolina wrote: You can try something like this:
string FilePath = MapPath("design.doc");
Response.ContentType = "Application/msword";
Response.AppendHeader("content-disposition", "attachment;filename="
+ "design.doc"); Response.WriteFile(FilePath);
Response.Flush();
Response.End();
i do have the same problem. but how does this work for files located
on another machine??
this does not work:
string FilePath = MapPath("file.log");
Response.ContentType = "text/plain";
Response.AppendHeader("content-disposition", "attachment;filename=" +
"http://domain.com/file.log");
Response.WriteFile(FilePath);
Response.Flush();
Response.End();
is there a way to get this working too??
greets
wolfgang
The AppendHeader line does two things:
- "attachment": makes the "save-box" pop up
- "filename": *suggests* a filename to use on the client-side
It does NOT specify the place to download the file from.
The WriteFile line places the server-file in the response-stream.
It might be possible to use UNC paths to point to a different
server in the local network (local as seen from the server!).
I don't think it is possible to point to a different webserver.
You might want to redirect instead! (also saves some network
traffic: why first get the file from the other server to your server
only to send it out again to the client?)
Hans Kesting