G
Guest
Hi,
I know, this question was posted few times already,
but I failed to find a definitive answer.
A usual answer is to use System.Net.WebClient.DownloadFile,
but it does not work for me because:
- I need the HTTP request to be identical (or very close)
to what IE normally sends (this includes cookies and other headers).
URLDownloadToFile is good at that, but WebClient is not.
- I need to be notified about progress status, in particular about
redirection and Mime type. URLDownloadToFile gives a very
detailed progress and status, but WebClient only gives the
number of bytes downloaded.
Other people suggest using HttpWebRequest directly, set headers manually,
initialize CookieCollection, etc, etc, etc. But all of this is such a pain!
I wonder whether even the later version of .NET still does not have
a convenient API for file download.
Thank you
John
I know, this question was posted few times already,
but I failed to find a definitive answer.
A usual answer is to use System.Net.WebClient.DownloadFile,
but it does not work for me because:
- I need the HTTP request to be identical (or very close)
to what IE normally sends (this includes cookies and other headers).
URLDownloadToFile is good at that, but WebClient is not.
- I need to be notified about progress status, in particular about
redirection and Mime type. URLDownloadToFile gives a very
detailed progress and status, but WebClient only gives the
number of bytes downloaded.
Other people suggest using HttpWebRequest directly, set headers manually,
initialize CookieCollection, etc, etc, etc. But all of this is such a pain!
I wonder whether even the later version of .NET still does not have
a convenient API for file download.
Thank you
John