ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Post here if you experience file transfer problems or unexpected errors.
Hi
I have small problem with the check of $result of PUTFILE()

when I make a script
Code: Select allADDEXCLUSION(UPLOAD,"dont_transfer.txt") $result=PUTFILE("dont_transfer.txt")
I become $result==OK

I think it should be !ok - no file were transferred..
What is wrong?
Hi,

Thank you for the feedback. I have tested the issue it with this script
Code: Select allOPENHOST("127.0.0.1","carl","123456") $result=PUTFILE("dont_transfer.txt") PRINT($result)
and got that $result is 12011 which is different than "OK".

Could you test the script and post here the output?
Hi,

Thanks for your reply.

I've got $result=12011 ONLY when file "dont_transfer.txt" dosn't exist in local directory
When this file exist but is in exclusion-list (so in effect shoudn't be transferred) I've got $result=OK

Perhaps it is okay, but I've understand that $result=OK only when the file was transferred (Am I wrong?)
In this case $result=OK always when no error occurs

How can I check if the file was transffered? Now I'm using GETTRANSFERREDFILESCOUNT() befor and after PUTFILE. Perhaps there is another way to check it?
Hello,

Well, you are right, but note that the ScriptFTP commands return an error only if an error happened and in this case no error ocurrs: The file is found but is not actually uploaded because it is in the exclusion list. So in my opinion PUTFILE in this case should return "OK"

But... mmm yes, it could be interpreted in the way you said. This case is may be in the limit of what is considered an error and what not.

Regarding to your workaround with GETTRANSFERREDFILESCOUNT() is completely valid. I think there is not a better way to do so.