File rename when upload is finished

Advertisement

AlLeX_
Joined:
Posts:
13

File rename when upload is finished

Hi All,

I have the following task to do: Upload large files to the sftp server and when the upload process finishes I have to rename the file so that I can mark this as uploaded and ready for further processing. So my question is - is there anything that I can use to automatically rename the remote file when the upload finishes?

Thanks!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: File rename when upload is finished

You can rename file explicitly after upload using mv command:
https://winscp.net/eng/docs/scriptcommand_mv

If you do not have any specific naming convention, you can make use of "Transfer to Temporary Filename" feature that uploads file with .filepart extension and removes it after transfer finishes. It's possible with SFTP protocol only. It's done automatically for large files.
https://winscp.net/eng/docs/resume#automatic

Reply with quote

AlLeX_
Joined:
Posts:
13

Hello Martin,

I am trying the first option. I have set Enable Transfer Resume/ Transfer to Temporary File Name for All Files. But When I am uploading a file its name does not change during the upload process. I am opening the second session to the SFTP server during the upload and can see that the file name is the same. Am I missing something?

Thanks!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

AlLeX_ wrote:

I am trying the first option. I have set Enable Transfer Resume/ Transfer to Temporary File Name for All Files. But When I am uploading a file its name does not change during the upload process. I am opening the second session to the SFTP server during the upload and can see that the file name is the same. Am I missing something?
Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum