SFTP difference between downloadfile and GetFile of SFTP

0 votes
asked Jun 12, 2015 by ndsinfodeveloper (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
commented Jun 12, 2015 by Tomas Knopp (58,890 points)
edited Jun 12, 2015 by Tomas Knopp
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
answered Jun 12, 2015 by Tomas Knopp (58,890 points)
selected Jun 15, 2015 by ndsinfodeveloper
 
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.

commented Jun 12, 2015 by Tomas Knopp (58,890 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.
...