1

I'm using the WebClient class to upload images over HTTPS to a server. My C# client code talks to a web service written in PHP. I have checked all the apache settings in php.ini.

The exception that gets thrown is as follows :

System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)

It doesn't happen always (it happens around 10% of the time).

abatishchev
  • 98,240
  • 88
  • 296
  • 433
AyushISM
  • 381
  • 7
  • 21

1 Answers1

1

If you research it a little bit, you will see that the common solution to this is to set KeepAlive property of the Request to false. Another one is just to increase the timeout of the request. Be aware the timeout is in milliseconds.

Check out these questions:

Jon Schneider
  • 25,758
  • 23
  • 142
  • 170
mybirthname
  • 17,949
  • 3
  • 31
  • 55