home *** CD-ROM | disk | FTP | other *** search
- ; *****************************************************
- ; Example12.ftp
- ; =============
- ; This example shows how to check both remote and local
- ; filesizes!
- ; -----------------------------------------------------
- ; This example also shows the use of these commands:
- ; Message "text..."
- ; INPUT (into a variable)
- ; Variable checking
- ; -----------------------------------------------------
- ; 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:
- :Transfer
- binary
- send "c:\autoexec.bat" "autoexec.bat"
- ; Check if files have identical sizes...
- if Local-FileSize("c:\autoexec.bat") = Remote-FileSize("autoexec.bat") then
- Message "Send completed successfully"
- endif
- if Local-FileSize("c:\autoexec.bat") != Remote-FileSize("autoexec.bat") then
- Let A = Local-FileSize("c:\autoexec.bat")
- Let B = Remote-FileSize("autoexec.bat")
- Message "Sizes mismatch: Local: %%A%% Remote: %%B%%"
- Input C "Want to try transfering again (Y/N)?"
- if %%C%% = "Y" then
- goto Transfer
- endif
- if %%C%% = "y" then
- goto Transfer
- endif
- endif
- ; End of transfer
-
- ; ******* Afterwards, disconnect from host!
- disconnect
-
- ; ******* At last, Hangup Internet connection!
- ; Hangup
-