Locking File when uploading / downloading

Advertisement

housingbust
Joined:
Posts:
3
Location:
Canada

Locking File when uploading / downloading

I am using the .Net library to upload/download files.

I *believe* this is the issue I am seeing:
When I use Session.GetFiles(...) it does not appear to lock the file when writing. As a result, I have another application (namely, BizTalk's File Adapter), picking up the file before WinSCP has finished writing it.

My Question to confirm is -- does WinSCP support file locking when downloading/getting? and likewise, when uploading?

I am using SFTP... currently from a UNIX FTP server to Windows machine. However, I will also be uploading from Windows Machine to either/both Unix/Windows as well.

Thank you.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Locking File when uploading / downloading

housingbust wrote:

My Question to confirm is -- does WinSCP support file locking when downloading/getting? and likewise, when uploading?
No, because it has to be supported by the SFTP server in the first place. And absolute majority of SFTP servers (OpenSSH for instance) does not support it.

As an alternative you can force transfer to temporary file name, if the BizTalk's File Adapter can be configured to ignore certain files/extensions.
See https://winscp.net/eng/docs/ui_pref_resume#temporary

Reply with quote

Advertisement

You can post new topics in this forum