I know that WebClient doesnot have the property of timeout. I searched around and found different codes in which you can inherit the webclient from httpwebrequest and set the timeout For Example:
class MyWebClient : WebClient
{
protected override WebRequest GetWebRequest(Uri address)
{
WebRequest request = base.GetWebRequest(address);
if (request is HttpWebRequest)
{
(request as HttpWebRequest).KeepAlive = false;
(request as HttpWebRequest).Timeout = 25000; //(tried different values)
}
return request;
}
}
But nothing seems to work here. The timeout occurs exactly after 100 seconds. I am trying to upload big file through this client application i made. PHP is running on the server side and all timeouts/maxupload values are set.
The exception message is :
the request was aborted the request was canceled
Please help me out.