Payload Cannot be more then 32,768 kb

Feb 20, 2012 at 3:36 PM

I am trying to upload a file that is only 2,654 kilobytes and for some reason, when I try to upload this file, I get an error that states: Payload Cannot be more then 32,768 kb.  How can I get rid of this issue?

Feb 21, 2012 at 1:13 PM



Can you specify more information?

Like code example? Server you connecting to?

Also, is it possible for me to see this problem? like some kind of test account, so I could recreate it and fix it faster this way.




Apr 10, 2012 at 11:29 PM



I am also getting this error.


Renci.SshNet.Session.SendMessage(Message message) in C:\Open.Source\renci.sshnet\sshnet-15645\Renci.SshClient\Renci.SshNet\Session.cs: line 663Renci.SshNet.Channels.Channel.SendMessage(ChannelDataMessage message) in C:\Open.Source\renci.sshnet\sshnet-15645\Renci.SshClient\Renci.SshNet\Channels\Channel.cs: line 445Renci.SshNet.Channels.Channel.SendData(Byte[] buffer) in C:\Open.Source\renci.sshnet\sshnet-15645\Renci.SshClient\Renci.SshNet\Channels\Channel.cs: line 210Renci.SshNet.Sftp.SftpSession.SendMessage(SftpMessage sftpMessage) in C:\Open.Source\renci.sshnet\sshnet-15645\Renci.SshClient\Renci.SshNet\Sftp\SftpSession.cs: line 80Renci.SshNet.Sftp.SftpSession.SendRequest(SftpRequest request) in C:\Open.Source\renci.sshnet\sshnet-15645\Renci.SshClient\Renci.SshNet\Sftp\SftpSession.cs: line 255Renci.SshNet.Sftp.SftpSession.RequestWrite(Byte[] handle, UInt64 offset, Byte[] data, EventWaitHandle wait) in C:\Open.Source\renci.sshnet\sshnet-15645\Renci.SshClient\Renci.SshNet\Sftp\SftpSession.cs: line 406Renci.SshNet.SftpClient.InternalUploadFile(Stream input, String path, SftpUploadAsyncResult asynchResult, Flags flags) in C:\Open.Source\renci.sshnet\sshnet-15645\Renci.SshClient\Renci.SshNet\SftpClient.cs: line 1278Renci.SshNet.SftpClient.UploadFile(Stream input, String path) in C:\Open.Source\renci.sshnet\sshnet-15645\Renci.SshClient\Renci.SshNet\SftpClient.cs: line 497


I cannot give you an account to the FTP server.   The software of the ftp server is serv-u if this might help.  The file I am opening and sending is only 64k.

 using ( FileStream fileStream = fileInfo.OpenRead())                {                    sftpClient.UploadFile(fileStream, Path.Combine(destinationFolder, fileInfo.Name));                }


nothing too complicated about that.


Also, it should be "than" and not "then" in the error message.

Apr 11, 2012 at 3:33 PM

In SftpClient.cs I changed the Constructor public SftpClient(ConnectionInfo connectionInfo) to have a smaller buffer size

this.BufferSize = 1024 * 32 - 50;

and it seemd to work for me. Try it out.

Apr 13, 2012 at 12:55 PM



Alex is right,

If you make your buffer smaller it should work.


What happens here is when SFTP operations are used it wraps SFTP message into SSH message and if it includes data message then it will be a little bit bigger that allowed 32Kb size.




Jun 7, 2012 at 4:22 PM

Got the same issue and solved as alexoi suggested :-)