Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Server Error in '/Roscon' Application.

Bytes to be written to the stream exceed the Content-Length bytes size specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.ProtocolViolationException: Bytes to be written to the stream exceed the Content-Length bytes size specified.


Source Error:


Line 37: StreamWriter writer = new StreamWriter(hwRequest.GetRequestStream());
Line 38: writer.WriteLine(message);
Line 39: writer.Flush();
Line 40: writer.Close();
Line 41:

Source File: C:\TREE\Travelt.aspx.cs Line: 39



Pls advice
Posted

 
Share this answer
 
You probably have to properly set the hwRequest.ContentLength property, see this code sample here at MSDN[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900