Topic "Prevent access to file until upload complete"

Author Message
gnich
[View user's profile]

Joined: 2012-07-24
Posts: 2
Location: London, England
Hi All,

My problem is how to stop people accessing the file until the upload has been completed.

Im new to scripting WinSCP and currently moving a program from MS Access to VB.net. In the Access version scripting is used and uploads the file with filename.ext.tmp and then uses MV to rename it to filename.ext. In the new VB.net version Im trying to use the winSCP.dll (WinSCP 5.0.7 beta) I can upload the file but the .net version of MV is not available. What would be the best thing to do?

Any help would be gratefully received

Thanks
GNich
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
If you can wait couple days, 5.0.8 with Session.RenameFile will be out.
Or you can use Session.ExecuteCommand to execute protocol-specific command to rename the file.
_________________
Martin Prikryl
gnich
[View user's profile]

Joined: 2012-07-24
Posts: 2
Location: London, England
prikryl wrote:
If you can wait couple days, 5.0.8 with Session.RenameFile will be out.
Or you can use Session.ExecuteCommand to execute protocol-specific command to rename the file.


Thanks for the update, I've got a few days before the program needs to go to user testing so I'll wait and hope to include it in the production version.

What I have done for the moment is to use the following, which is working OK with our FTP server

session.ExecuteCommand("RNFR /folder/Filename.txt.tmp")
session.ExecuteCommand("RNTO /folder/FileName.txt")

GNich
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License