Question:
When i tried to read a 9 megabyte text file from SFTP server using sftp.ReadFileText32 only 65535 characters were returned ? Why's that ? I just tried sample from chilkat site. http://www.example-code.com/vbdotnet/sftp_readTextFile.asp
Thanks
I tested the same, but did not reproduce the problem. Verify that the problem still exists in the very latest version of Chilkat. If so, then post the contents of the LastErrorText captured after the call to ReadFileText32.
I'll verify with the very last version but, in the meantime i just found simple solution for this problem.
This is the original way to read text file :
Dim charset As String
charset = "ansi"
Dim offset32 As Long
offset32 = 0
sFileContent = sftp.ReadFileText32(handle, offset32, numBytes, charset)
If (sFileContent = vbNullString) Then
MsgBox(sftp.LastErrorText)
Exit Function
End If
And this is modified way to do the same thing but this time reading whole file.
Dim charset As String
charset = "ansi"
Dim offset32 As Long
offset32 = 0
sFileContent = ""
Do
sFileContent = sFileContent & sftp.ReadFileText32(handle, offset32, numBytes, charset)
If (sFileContent = vbNullString) Then
MsgBox(sftp.LastErrorText)
Exit Function
End If
offset32 = sFileContent.Length
Loop Until sftp.Eof(handle)
Hope this simple modification will help someone else with the same problem.