Script

FTP

The professional tool to automate FTP, SFTP, FTPS

and schedule FTP batch jobs

MENU MENU
Post here if you experience file transfer problems or unexpected errors.
Hi.

I'm receiving (get) into a windows 2008 pdf files from a as400 (a server by IBM).
Sometimes, but rarely, some received file is empty but in the source this is not empty.
Is it possible to send a mail (a warning messagge) when this happens?
It is possible to investigate about this trouble?

Best Regards
It may happen when the downloaded file is being used by another program in the FTP server in the precise moment when it is downloaded.

For example, if there is another program uploading the PDF files to the server folder and if, in that precise moment ScriptFTP is run, some files may be partially downloaded, not downloaded at all or downloaded with 0 bytes as it happens in your case. It depends a lot on the kind of FTP server and what it decides to deliver to the FTP client in these cases.
Hi.
Thanks for your answer.
Is it possible to check the number of received bytes to send a mail if it is 0?
Best Regards
Hi,

Yes, take a look at the following script. It checks the size of every file in a local directory:

[scriptftp="check_file_size.ftp"]# Set the current local directory
LOCALCHDIR("C:\MYDIR\SUBDIR")

# Get the list of files in the current local directory
GETLIST($list,LOCAL_FILES)

# For each directory in $list check its file size
FOREACH $item IN $list
$file_size=GETFILESIZE(LOCAL,$item)
# Check file size
IF($file_size==0)
# Send email
# See how in the help topic: http://www.scriptftp.com/reference.php?go=topic123
END IF
END FOREACH[/ScriptFTP]
Hi.
Your idea is working very well.
Thank you very much.
Thanks for the follow-up Mauri