Source language: Translate to:

FTP Download only files wich are New

Questions about our File Management and Internet FTP plug-in

FTP Download only files wich are New

Postby Dudus » Fri Sep 29, 2017 5:35 am

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
Dudus
 
Posts: 97
Joined: Wed Sep 07, 2005 12:15 pm
Location: Hungary, Budapest

Re: FTP Download only files wich are New

Postby Gaev » Sat Sep 30, 2017 7:04 pm

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
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to NeoBookFM/FTP

Who is online

Users browsing this forum: No registered users and 0 guests