Download file - error 406

  • Thread starter Thread starter Jared
  • Start date Start date
Jared said:
Hi,

Dim wc As New System.Net.WebClient()
wc.DownloadFile("http://jared.site.net.au/resort/version.txt",
"c:\mytext.txt")

The remote server returned an error: (406) Not Acceptable

But I can see the file on IE. What is the problem?

Thanks
JAred

Jared,

Usually a 406 means you're not accepting the content type the server
wants to send. The most common example would be if your client doesn't
support gzip'd content sent by the server. Look into the header
"Accept." I think a WebClient instance has a Headers property.

Dan Manges
 
Back
Top