ftp GET - < ftp_getfile >() ... [Pro]
ftp GET <ftp_getfile>("File","Remote file","Login name","Password","Silent") Available in: Professional edition
|
Downloads file from a remote FTP server.
|
#
|
Parameter name
|
Parameter description
|
1
|
File
|
Full path to the file on local machine. If the file already exists it will be overwritten without a prior prompt.
|
2
|
Remote file
|
Full path to the remote file (e.g., ftp://pitrinec.com/pub/test.txt). The file path can contain * and ? wildcards. In such a case the "LocalFile" parameter must contain folder where to store multiple files received.
|
3
|
Login name
|
User login name. If empty the "anonymous" is considered.
|
4
|
Password
|
User name login password.
|
5
|
Silent
|
Silent mode. If set to 1 then the operation progress window is not displayed.
|
|
|
Example (Macro Steps):
|
1
|
<#> <#> This macro downloads "test.txt" file from pitrinec.com
|
2
|
<#> <#>
|
3
|
Macro execution: ONLY COMMANDS
|
4
|
Message SHOW "" : "Where To Save Downloaded File?" (other parameters: x = 32, y = 32, Window title = Message, Buttons = None, Timeout (seconds) = , Always on top = ).
|
5
|
Variable OPERATION "SELECT_FOLDER" (Variable for result = vLocalFolder, Input text/variable = , Parameter 1 = , Parameter 2 = , Parameter 3 = 0)
|
6
|
IF STRING _vCanceled==1
|
7
|
Macro EXIT
|
8
|
ENDIF
|
9
|
Message CLOSE
|
10
|
ftp GET "ftp://pitrinec.com/pub/test.txt" (Login name=anonymous) to file "%vLocalFolder%\test.txt"
|
11
|
Message SHOW "" : "File is downloaded. Do you want to open it?" (other parameters: x = -100, y = -100, Window title = Message, Buttons = Yes and No, Timeout (seconds) = , Always on top = ).
|
12
|
IF STRING _vMsgButton==YES
|
13
|
File OPEN open file "%vLocalFolder%\test.txt" in system default viewer.
|
14
|
ENDIF
|
|
Example (Plain Text):
<#> This macro downloads "test.txt" file from pitrinec.com
<#>
<cmds>
<msg>(32,32,"Where To Save Downloaded File?","Message",0)
<var_oper>(vLocalFolder,"",SELECT_FOLDER,"","", "0")
<if_str>("_vCanceled==1")<#>
<exitmacro><#>
<endif>
<msgoff>
<ftp_getfile>("%vLocalFolder%\test.txt","ftp://pitrinec.com/pub/test.txt","anonymous","")
<msg>(-100,-100,"File is downloaded. Do you want to open it?","Message",2)
<if_str>("_vMsgButton==YES")
<fileopen>("%vLocalFolder%\test.txt",0)
<endif>