Topic "Get & Put save only if the transfer is completed."

Author Message
Dimitris

Guest


Hello, i need your help!!! Very Happy Very Happy

That's my senario:

I have an FTP server(in IIS @server21012R2 ) in branchA
I have winscp client in Branch B
I run the following script at Branch B every hour:
-----------------------------------------------------------
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to FTP server using a password
open ftp://username:password@192.168.1.1:21
# download file delete after completion exclude subfolders
cd /Outbox/
Option exclude */
get -delete *.* F:\Sync\Inbox\*.*
# Disconnect
close
exit
----------------------------------------------------------------



With this senario if i lost the connection while the files transfering. I receive one file for example "test.txt" which is not completed.
Because it is not completed it will not be deleted from the server and when it comes the time to repeat the script it i will be received completely.

The problem is that i don't want to save the file if it is not completed download because i use that files for another operation and until running again the script i have already used these files and i received errors to the application.

Is there any way to solve it? Thanks in advance. If you want any details i can upload



Additionally i do the same for the uploading:
-----------------------------------------------------------------
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to FTP server using a password
open ftp://username:password@192.168.1.1:21
# Upload file After complete delete files from source
cd /Inbox
Option exclude */
put -delete F:\Sync\Outbox\*.*
# Disconnect
close
exit
-----------------------------------------------------------------
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
There's no easy solution with FTP protocol.
With SFTP, WinSCP appends a .filepart extension to incomplete files. But not with FTP.
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