Commands & Syntax > Commands > Networking/Web/E-mail >

www.perfectkeyboard.com

 

Http DOWNLOAD - < download >() ... [Pro]

 

Http DOWNLOAD
<download>("File","Remote file","Login name","Password")
Available in: Professional edition

Downloads file from a HTTP 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., http://www.pitrinec.com/index.html).

3

Login name

User login name. If empty the "anonymous" is considered.

4

Password

User name login password.

 

Example (Macro Steps):

 

1

<#> <#> This sample macro downloads home page file from www.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

Http DOWNLOAD "http://www.pitrinec.com/index.html" (Login name=) to file "%vLocalFolder%\index.html"

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%\index.html" in system default viewer.

14

ENDIF

Example (Plain Text):

 

<#> This sample macro downloads home page file from www.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>

 

<download>("%vLocalFolder%\index.html","http://www.pitrinec.com/index.html","","")

 

<msg>(-100,-100,"File is downloaded. Do you want to open it?","Message",2)

<if_str>("_vMsgButton==YES")

   <fileopen>("%vLocalFolder%\index.html",0)

<endif>