Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download Script

Status
Not open for further replies.

jlkpal

Programmer
Sep 10, 2005
14
US
I've been spinning my wheels trying to create a download script. The GETFILE ZMODEM command just doesn't seem to compile.

Does anyone have a sample script to download a file? Unfortunately, I wasn't able to get the Aspect Script sample cds, which may have some good examples of the download...

Thanks in advance!
 
Zmodem does not let you specify the filename during the transfer, so you have to intercept the filename and then copy/rename it afterwards. Here is a script that shows how to do this:

proc main
integer iStatus
string sDownloadFile ;Fully-qualified filename being downloaded
string sRenameFile ;Fully-qualified filename to rename downloaded file to

getfile ZMODEM
iStatus = $XFERSTATUS
while iStatus == 1
if nullstr sDownloadFile
sDownloadFile = $XFERFILE
endif
iStatus = $XFERSTATUS
endwhile
if iStatus == 2
;Transfer successful, continue with script execution
rename sDownloadFile sRenameFile ;Rename downloaded file to desired name
elseif iStatus == 3
;Transfer failed, perform error handling
endif
endproc


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top