0 kb empty file upload crashes server

Feb 14, 2012 at 5:22 PM

When I try to use the following code to upload a zero kilobyte sized file with nothing in it, it crashes the server.  The server is a GlobalScape FTP server.  Please tell me if there is a workaround for a solution to this problem.

 

 

private void UploadFile()

{

 

using (var sftp = new SftpClient("fileservernet", 22, "usertest", "passwordtest" ))

{

sftp.Connect();

 

using (System.IO.Stream stream = new System.IO.FileStream("C:\\Users\\Me\\Desktop\\zero.txt", FileMode

.Open))

{

sftp.UploadFile(stream,

"zero", true

);

}

 

sftp.Disconnect();

}

Coordinator
Feb 16, 2012 at 1:41 PM

How does it crashes the server, what it say?

 

Can you provide more information?

 

Thanks,

Oleg