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?
Bye
schluri
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
Many thanks.# 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\")
Bye
schluri
Ok, I found the solution:
Bye
schluri
Code: Select all
It add the extension .SND to each successful uploaded file.EXEC('ren "'.$item.'" "'.$item.'".SND"')
Bye
schluri
Thanks for the update schluri
liked Script FTP? Try our other product Email Parser