Download a file from any given URL and save it to my Machine with ASP.NET

asp.net, download, file

Solution

You can use webclient or httpwebrequest. Webclient is probably easier for what you want to do.

WebClient wc = new WebClient();

wc.DownloadFile(downloadURL.Text, savePath.Text);

Problem

Case: I need to feed my application a URL from any location on the internet. At the other end of the URL will be a file of some sorts. A picture/video/document and I need to save this item to my server automatically without a 'save-as' dialog box. This needs to be done in ASP.NET. Im having trouble on how to actually grab that file with asp.net after feeding it a URL... Any help would be great! Thanks all

Original source