I am working on an ASP.NET site that allows users to upload files.
Previously, the files were stored on the same server as the website, so that we can:
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
Response.AddHeader("Content-Length", response.ContentLength.ToString());
Response.ContentType = "application/octet-stream";
Response.TransmitFile(path);
Response.End();
However, now some files are stored on a separate server. I can check if files exist using
WebRequest request = WebRequest.Create(absolute-url);
WebResponse response = request.GetResponse();
But how can I facilitate the transfer, since TransmitFile requires a virtual path, not a URL?
I need so that users can choose where to save the file, as with a normal download on the Internet
What is the best way to do this?
source
share