The underlying connection was closed the server committed a protocal violation [Resolved]

Posted by Chantimorchi under C# on 2/29/2016 | Points: 10 | Views : 8466 | Status : [Member] | Replies : 3
hi I am facing issue with while upload the file from FTP it is working with debugger when i run this application in my local but once if removed debugger it is showing below error.

"The underlying connection was closed the server committed a protocol violation"

Can you please help me guys how to resolve this error.

waiting for response Thanks Advance.




Responses

Posted by: Sheonarayan on: 2/29/2016 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
The error message is generic.

Looks to be a problem of protocol, make sure that you are specifying the path to upload correctly. Generally, we write path like

var fileName = Server.MapPath("~/myuploadFolder/fileName.jpg");

In this case, you would like to upload the file in myuploadFolder that is in the root of the application. You are not specifying the protocol, whether it is http or https or any other.

If you have some other protocol, change the path accordingly.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Chantimorchi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chantimorchi on: 2/29/2016 [Member] Starter | Points: 25

Up
0
Down
file name i am passing static like FileName1 = "TestSample_" + YearID.ToString() + MonthID.ToString() + ".TXT";

Chantimorchi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Professionaluser on: 3/2/2016 [Member] [MVP] Bronze | Points: 25

Up
0
Down
refer this link and see if it work for you
http://www.vbforums.com/showthread.php?585077-RESOLVED-The-server-committed-a-protocol-violation

Chantimorchi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response