I am currently evaluating the SFTP portion of SecureBlackbox (Java Version) and currently have my own working version of the sample Sftp Server. I can successfully upload only certain types of files like text and UTF-8 at the moment but when I try to re-download them I get the following error:
Couldn't stat remote file: No such file or directoryI am using SSH-2.0-OpenSSH_6.7 and Transmit as the clients. This issue does not occur in FileZilla as I am able to read the files just fine. Also, I have tried setting all the READ, WRITE, EXECUTE permissions of TElSftpFileAttributes to true to see if that helped any but no luck.

Does the file actually exist (i.e. is it created after upload) on your server?

In general, the file operations are handled via event handlers in your code (or in sample code). You can put a breakpoint in the event handler for OnOpenFile event and see if it's reached when you try to download the file, and if it is, what's going on in the event handler (is the correct path specified, is the file opened etc).

The file is never written to disk. It is intentionally virtual and is kept only in memory. The request never makes it to TElSFTPServerOpenFileEvent. However, I do see that TSSHReceiveEvent gets hit twice and TSSHSendEvent gets hit once before I see the message outputted on my OpenSSH client.

Utilizing the latest SFTP Server sample (writes to disk) out-of-the-box, I have no issues with retrieval of a file. How can I achieve the same result when files are never written disk? This is our use-case and writing to disk for us is not an option. Please advise on the next steps. Thanks.

The fact that the unmodified server works means that the problem originates from your code which handles events. Most likely directory listing event handler needs correction. Unfortunately that's all we can say without debugging your code.

For the benefit of anyone who may need it in the future. Indeed it was a logic error in TElSFTPServerRequestAttributesEvent. Once I fixed the logic, I was able to download some files successfully. Other files failed to download with the following error:
Corrupted MAC on input.
Disconnecting: Packet corruptThe cause of this error is something else and I believe it may be associated to issue #32766 .

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.