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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP retrieval with Aspect

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm a complete amature looking for help. Is it possible to write something in Aspect that can log on to and FTP site and retrieve a file? The file name changes according to the date.

I'm using Procomm 4.8. All the scripts I've put together so far start with me recording my action to get the bulk of the work done, but with I'm in the FTP mode I can't do that so I'm not sure it's possible at all.
 
You can control file transfers with Aspect using the Getfile command. How you specifiy the correct file depends on the host system. Examples of the getfile commands are:
Getfile Zmodem
or
Gefile YModem

You can add a filename to the end of the Getfile command if that is how the host knows what file to send. Otherwise, it may prompt you for the filename before the transfer starts. If the file format is always the same and only the date changes, you can create a variable that writes the file name into your script using the PC date string.
Glad to help if you still need it and have a description of the FTP process.
 
The following example came from the symantec web site at:


This document contains some very useful aspect ftp commands.

---------------------------------------------

How to Use the FTP Command in ASPECT

Details:
The following example covers just about everything you can do with the FTP command. Unfortunately the ASPECT on-line help system does not have examples of the FTP commands. However, the following should do the trick. Note: Keep an eye out for filenames. In FTP commands they are case-sensitive.

;FTP.WAS ASPECT Script for Procomm Plus 4.x
;Example script with FTP commands.

proc main

FTP LOCAL CHDIR "C:\test\" ;Set the local dir. to C:\test\.
Connect FTP "Quarterdeck" ;Connect to Quarterdecks FTP site.
while $ftpstatus ;Loop while connecting to FTP site.
yield
endwhile
pause 1 ;Let Procomm update its screen.
FTP REMOTE CHDIR "/pub/procomm-windows/us/ver-4/" ;Change dir on FTP site.
pause 1
FTP REMOTE COPYFILE "pw4mdm.lst" ;Copy (download) pw4mdm.lst from FTP
;site to local machine. Filenames
;are case-sensitive!
while $ftpstatus ;Yield while transferring file.
yield
endwhile
FTP LOCAL RENAME "pw4mdm.lst" "new.lst" ;Rename the local filename.
pause 1 ;Let Procomm update its screen.
FTP REMOTE CHDIR "/upload/" ;Change dir on FTP site to /upload/.
pause 1 ;Let Procomm update its screen.
FTP LOCAL COPYFILE "new.lst" ;Copy (upload) file to FTP site.
while $ftpstatus ;Yield while transferring file.
yield
endwhile
disconnect
endproc

------------------------------------

Hope this helps.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top