Trying to setup a personal image upload/downloader webpage. I’ve viewed the msdn article on the function, and it runs fine but I cant figure out where it saves the file to.
var request = new WebClient();
request.DownloadFile("https://someabosolute/image/path/andfilename.png", "file.png");
Any Ideas?
@ escape or \ resolve an invalid character issue once you change filename.png to C:\tmp\filename.png. However using jsut a file name causes to errors everything runs but I cannot find the file. Even checked Windows security and application logs and there nothing relating to the time frame.
SO where should the file be saved to in a web application when you only specify a filename as the second parameter in the DownloadFile() method of system.net.webclient.
According to the example in the Microsoft Documentation, the file will be downloaded to
Application.StartupPath. If only a filename is provided, it will be saved in the same path as where your executable is.Keep in mind that for some applications (e.g. ASP.NET web applications) there may be a permission issue saving the file in the same folder as the executable.
}