FTP Download only files wich are New

Questions about our File Management and Internet FTP plug-in
Locked
User avatar
Dudus
Posts: 120
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

FTP Download only files wich are New

Post by Dudus »

Hi,

can you tell me how to download files from FMFTP without overwrite? for example:
C:\TEST contains
01.txt
02.txt
03.txt

FTP Remote directory has
01.txt
02.txt
03.txt
and 04.txt

In this case download only 04.txt file because the 1,2,3 are already in my local directory.
Please help me.

Thank you!
Dudus
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: FTP Download only files wich are New

Post by Gaev »

Dudus:

Here is the gist of the script ...

Code: Select all

fmConnectLocal "local connection id" "host" "properties"

fmConnectRemote "remote connection id" "host" "properties"
fmChangeDir "remote connection id" "path"
(optional) fmSetFileMask "remote connection id" "*.txt"
fmFileListToVar "remote connection id" "FullPath=No;IncludeFiles=Yes; IncludeFolders=No;SelectedOnly=No" "[Files]"

StrParse "[Files]" "!;" "[FilesArray]" "[FilesArrayLen]"

Loop "1" "[FilesArrayLen]" "[thisFileNumber]" 
   SetVar "[thisFileName]" "[FilesArray[thisFileNumber]]"
     
   fmFileExists "local connection id" "!c:\TEST\[thisFileName]" "[Result]"
   If "[Result]" "<>" "True" 
      fmCopyFrom "remote connection id" "[thisFileName]" "!C:\TEST" "options"
   EndIf
EndLoop
Locked