In fact, you need to know which way the browser will download the file.
For Internet Explorer, this is done via P / Invoke + Shell32 (stolen from this answer ):
[DllImport("Shell32.dll")] private static extern int SHGetKnownFolderPath( [MarshalAs(UnmanagedType.LPStruct)]Guid rfid, uint dwFlags, IntPtr hToken, out IntPtr ppszPath); var downloadFolderGuid = new Guid("{374DE290-123F-4565-9164-39C4925E467B}"); IntPtr pathPtr; int result = SHGetKnownFolderPath( downloadFolderGuid, (uint)0x00004000, new IntPtr(0), out pathPtr); if (result >= 0) return Marshal.PtrToStringUni(pathPtr); throw new ExternalException("Unable to retrieve the known folder path. It may not " + "be available on this system.", result);
(the full code for other cases and the value of constants, see the response by reference)
For other browsers, you will need methods specific to these browsers.
Having a path, you just need to upload the file to the desired path using webClient.DownloadFile :
using (var c = new WebClient()) c.DownloadFile("http://www.google.com/", Path.Combine(directory, "index.html"));
Or copy there, if you have everything within the same host:
File.Copy(@"C:\test.html", Path.Combine(directory, "test.html"));