Start file download via Code
-
Hi, I have two problems. Problem 1: I have an internal LAN web server which one provides file attachments. I'd like to cache the requestet file on the web server my asp.net site is hosted on. Is it possible to copy an file from one webserver to another via code? Problem 2: Now I'd like to provide the file download for the user. I know, that a direct link is one possiblity, but I'd lik to start the file download via code, too. Is ther any Method or something which handle this? thank in advance regards pdluke
-
Hi, I have two problems. Problem 1: I have an internal LAN web server which one provides file attachments. I'd like to cache the requestet file on the web server my asp.net site is hosted on. Is it possible to copy an file from one webserver to another via code? Problem 2: Now I'd like to provide the file download for the user. I know, that a direct link is one possiblity, but I'd lik to start the file download via code, too. Is ther any Method or something which handle this? thank in advance regards pdluke
pdluke wrote:
start the file download via code, too.
Response.WriteFile
Also check out this support KB: http://support.microsoft.com/kb/812406[^]Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
pdluke wrote:
start the file download via code, too.
Response.WriteFile
Also check out this support KB: http://support.microsoft.com/kb/812406[^]Vasudevan Deepak Kumar Personal Homepage Tech Gossips
Hi, thank for the fast response. I've tried the method from the Microsoft support page, tha you have linked. The Problem is that the exception says, that URI-Fromats can't be handled. regards pdluke
-
Hi, I have two problems. Problem 1: I have an internal LAN web server which one provides file attachments. I'd like to cache the requestet file on the web server my asp.net site is hosted on. Is it possible to copy an file from one webserver to another via code? Problem 2: Now I'd like to provide the file download for the user. I know, that a direct link is one possiblity, but I'd lik to start the file download via code, too. Is ther any Method or something which handle this? thank in advance regards pdluke
pdluke wrote:
Is it possible to copy an file from one webserver to another via code?
I think there is no direct method available. You can do in other way, webserver where files to be copied can request to the file located on this server using
WebClient
classesDownloadFile()
method.pdluke wrote:
Now I'd like to provide the file download for the user. I know, that a direct link is one possiblity, but I'd lik to start the file download via code, too. Is ther any Method or something which handle this?
Just do
Response.Redirect()
to the file you want to get downloaded. If file extension is not mapped with any ISAPI module, then browser will prompt Save dialogbox.