Scripting Example 13

; *****************************************************

; Example13.ftp

; =============

; This example checks if a local file is

; larger than 0 bytes - then it is tranferred!

; -----------------------------------------------------

; This example also shows the use of these commands:

; Message "text..."

; IF ... THEN ... ENDIF

; Goto <label>

; -----------------------------------------------------

; NOTE: This is just a sample - you are unable to

; execute the script unchanged... ;o)

; *****************************************************

 

; ******* First provide the Login information...

 

; DialEntry="xxxxxxx"

; DialLoginUser="xxxxxxx"

; DialLoginPassword="xxxxxxx"

Host="ftp.yourhost.net"

Port="21"

User="your.username"

Password="your.password"

; Proxy=

; ProxyPort=21

 

; ******* Timeout in seconds...

Timeout=120

 

; ******* ...Dial up if not already connected to the Internet...

; Dial

 

; ******* ...and then connect to FTP host...

connect

 

; ******* Command sequence...

 

remote-cd "/myfiles"

 

; Start of transfer part:

:TryAgain

binary

if Local-FileSize("c:\autoexec.bat") > 0 then

send "c:\autoexec.bat" "autoexec.bat"

if Success then

Message "Send completed successfully"

; Jump to end whereas there was a successful transfer...

goto End

endif

; We had a bad transfer, so jump to "TryAgain"!

goto TryAgain

endif

; End of transfer

 

:End

 

; ******* Afterwards, disconnect from host!

disconnect

 

; ******* At last, Hangup Internet connection!

; Hangup