I want to download a file and save it locally without any pop ups for user to choose location since its predefined. File format will most probably be pdf. Download file path will be an url and I want to save it locally. Do I go to work like this:
string fileName = "http://mail.example.com/download.asp?saveFile=example.pdf";
BinaryReader binReader = new BinaryReader(File.Open(fileName, FileMode.Open));
string path = "C:\\Domains\\shared.example.com\\pdf\\example.pdf";
using (BinaryWriter Writer = new BinaryWriter(new FileStream(path,FileMode.OpenOrCreate)))
{
Writer.Write(binReader);
}