0 votes
by (290 points)

Teere are two methods in SFTP object. GetFile and Download. What are the significant of each methods. What should be best method to use?

I have one more question that can we identify that file is still in process by other user which is Rebex SFTP object is going to download

Applies to: Rebex SFTP
by (58.9k points)
edited by
As to the 2nd question - in SFTP it is not possible to enforce exclusive access to SFTP server files. Can you share with us what exactly you need to achieve? If you need to make sure that no one changes the currently uploaded file, it can be solved by uploading the file first under a different generated name and only once the upload completes, then change it to the desired name.

1 Answer

0 votes
by (58.9k points)
selected by
 
Best answer

GetFile/PutFile methods are the more simple variants. They are designed to transfer one file with one method call.

Download and Upload methods are multi file (batch) operations which will allow you to specify and then upload or download a bunch of files to the server with just one method call.
Internally the Download and Upload methods still use the GetFile/PutFile plus they add more useful features like wildcards, FileSet class to specify set of files to transfer, auto-resuming failed transfers, auto detection of symbolic links, etc.

by (58.9k points)
So if you do not plan to do batch file transfers, and do not need any special features, just go for the simple GetFile/PutFile methods. Use them also if you need partial file transfer, or have full control over the resuming.

If you plan batch transfers, definitely go for Upload/Download methods. They can also be used for single file transfers in case you want to use one of their advanced features.
...