The underlying connection was closed. An unexpected error occured

M

Murugavel

Hi Guys,

I develope a one WebService for uploading the files to another service.It
is working fine upto file size is limitied that is 16 mb.if i am try to
upload the file which size is greater than 16 mb,i got the following error,

System.Net.WebException: The underlying connection was closed: Unable to
connect to the remote server.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at ASP.webrequest_aspx.btnSubmit_Click(Object sender, EventArgs e)

i read the some resolution for that which is,

protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = (HttpWebRequest) base.GetWebRequest(uri);

webRequest.KeepAlive = false;

return webRequest;
}

i found this code at
"http://support.microsoft.com/default.aspx?scid=kb;en-us;819450"

eventhough,i added this code to my reference.cs,still i am getting the above
error.
i am in very urgent.Kindly,help me.

thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top