I am trying to upload files to a web server using System.Net.WebClient.UploadFile but I keep getting a WebException. Specifically, I am getting 3 errors. I have no idea why
The exception "The request was aborted: The request was canceled." is thrown if the WebClient times out during a file transfer. If no file transfer is taking place, you will get "The operation has timed out" instead.
The timeout is occurring on the client. WebClient does not allow you to set the timeout and the default for HttpWebRequest (what WebClient uses) is 100 seconds. I guess I will have to figure out how to get the progress when using HttpWebRequest. I will also have to figure out why ASP.Net file transfer is slower than using SAFileUp with classic ASP.
UPDATE: I've created a WebHelper class that takes the place of WebClient but provides more access to the necessary features of the underlying WebRequest. It also provides a bunch of additional capabilities over the WebClient. If you are interested, it is available in the BizArk project on CodePlex.