TheJack38
TheJack38

Reputation: 414

Check if a file transferred successfully in WinSCP, when using the Session.PutFile function

I am trying to send some files to a remote FTP server, and I need to make sure the files actually make it there before I continue my code.

Is there a way to check if the file transferred successfully using the Session.PutFile method? It doesn't have the TransferOperationResult return type that Session.PutFiles does, and in fact returns void.

If at all possible, I would like to handle the files as Stream objects in memory, rather than saving them locally.

Upvotes: 1

Views: 1213

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202642

The Session.PutFile raises an exception, if any error occurs.

If it does not raise any exception, the upload was successful.

Upvotes: 1

Related Questions