Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.2k views
in .NET FTP by (160 points)
Hi,

I've just been handed a support request from an internal user of our application who's seen the following failure when the app does an SFTP upload of a file...

FileTransferException thrown by myFTPConnectionObject.UploadByteArray(byteBuffer, fileName)

FileTransferException.Message = "File not found (code=2)"

Things I've checked so far...
- we're using 5.0.5.0 of edtFTPnetPRO
- fileName is a legal file name
- Just before the UploadByteArray() I do a myFTPConnectionObject.ChangeWorkingDirectory(directory) and that completes fine, so I assume the connection to the server is OK and we're in the correct directory

I haven't been able to reproduce the problem using my desktop test SFTP server - uploads go out fine. I've asked the user to verify they can manually upload the file via CoreFTP using the same logon credentials and they can, so I guess that rules out any permissions problems.

Can you think of anything that might be causing this exception / message combination when performing an upload over SFTP?

Thanks
James

2 Answers

0 votes
by (162k points)
Are you able to get a log file at the All level?

One possibility is the chmod after the upload.

Try doing this:

ftp.ServerCompatibility = SecureFTPCompatibilityFlags.SSHDisableChmodAfterPut;
0 votes
by (160 points)
Thanks for getting back to me with the suggestion.

After a lot more debugging, I eventually traced the source of the problem to my application code.

It's good to know about the ServerCompatibility property though - may be useful to me in the future.

James

Categories

...