Prevent access to file until upload complete

Advertisement

gnich
Joined:
Posts:
2
Location:
London, England

Prevent access to file until upload complete

Hi All,

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

I'm 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 I'm 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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Prevent access to file until upload complete

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.

Reply with quote

gnich
Joined:
Posts:
2
Location:
London, England

Re: Prevent access to file until upload complete

martin 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

Reply with quote

Advertisement

You can post new topics in this forum