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.
Need help writing a script? Have any question about ScriptFTP?
Hi,

I want to rename the local files with EXEC("rename .$item .$item.SND") but it seems that the local command don´t know the variable "$item". Is there any way to rename file by file after a successful upload?
Code: Select all# Connect to FTP server OPENHOST("xxx","xxx","xxx") # Change the current local directory LOCALCHDIR("C:\test") # Get the local file listing, store it in $list GETLIST($list,LOCAL_FILES,"*.DAT") # Change current remote directory to /test CHDIR("/test") # For each file in $list... FOREACH $item IN $list # Upload the file $result=PUTFILE($item) # If the file has been uploaded successfully # rename the local copy. IF($result=="OK") EXEC("rename .$item .$item.SND") END IF END FOREACH # Transfer finished, close the connection CLOSEHOST # *.SND move in Archive EXEC("move c:\test\*.SND c:\test\archiv\")
Many thanks.

Bye
schluri
Ok, I found the solution:
Code: Select allEXEC('ren "'.$item.'" "'.$item.'".SND"')
It add the extension .SND to each successful uploaded file.

Bye
schluri
Thanks for the update schluri