Is there a script to check for zero bytes or empty file so we do not replace the existing file on the FTP site?
Hi,
You can check the size of a file with the command GETFILESIZE. It works this way:
You can find more info and some examples here:
https://www.scriptftp.com/d/ftp-file-commands/getfilesize
Also, if you are uploading many files you will have to use it within a FOREACH loop:
https://www.scriptftp.com/d/ftp-script-for-windows-getting-started/lesson-5-foreach-handling-file-lists
You can check the size of a file with the command GETFILESIZE. It works this way:
FTP Script
- # Upload the file data.log only if its size is greater than 0
You can find more info and some examples here:
https://www.scriptftp.com/d/ftp-file-commands/getfilesize
Also, if you are uploading many files you will have to use it within a FOREACH loop:
https://www.scriptftp.com/d/ftp-script-for-windows-getting-started/lesson-5-foreach-handling-file-lists
liked Script FTP? Try our other product Email Parser
Why do you have to use the FOREACH loop when uploading many files? What kind of issues do you get if you don't? I'm just curious.
You can avoid using FOREACH if you want. For example:
But sometimes it is preferred to use FOREACH to do some operations per file. For example:
FTP Script
But sometimes it is preferred to use FOREACH to do some operations per file. For example:
liked Script FTP? Try our other product Email Parser