Topic "How to not ftp a file if the file size is <1K"

Author Message
petant

Guest


I am using verison 5.1.7.

The goal is to not PUT a file on an FTP server if the file is a size 0 text file which has no data.

I have found your documentation online where you state I can use the following:

"size[KMG] Matches files smaller than size. <1K "

I am not sure exactly where to put this matching code. Do I use the <1K on the PUT command?

If I don't want to PUT a file if it is less than 0K do I use <0K?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Use put * -filemask=*>1K /target/path/ to upload all files larger than 1 KB.

See https://winscp.net/eng/docs/file_mask#size_time

Quote:
If I don't want to PUT a file if it is less than 0K do I use <0K?

That does not make sense. A file cannot have a negative size (less than 0).

Last edited by martin on 2015-03-25; edited 1 time in total
petant

Guest


I have tried the recommended approach but it's not working. I don't get an error. It just seems to stop.

Here is the script that I am running:

option batch abort
option confirm off
open "ftp://bla-bla-bla" -explicitssl -certificate="xyz"
lcd N:\Data
put 57-1-104352.txt >1K
put 57-1-104354.txt >1K
put 57-5-105442.txt >1K
put 57-8-106914.txt >1K
put 57-169-143038.txt >1K
close
exit
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Sorry, my answer was wrong. I've corrected it.
_________________
Martin Prikryl
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