AnsweredAssumed Answered

vrf - FTP help?

Question asked by VRFuser on Feb 16, 2000

Jeff,

Below is a document I had written a couple of years ago discussing this very
topic. In the Win95/NT environment you can create a batch file that contains
the appropriate login and FTP commands and execute ftp with a -s option to
specify a script file to run. I have not tested this in Windows 98 or 2000, but
I would expect Microsoft keeping the same command line options for the ftp
program.

Hope this helps,

Lyle Carnahan
Agilent Technologies
lyle_carnahan@agilent.com


Type: Technicalnote

Situation:
    Using FTP within HP VEE environment on a PC to transfer files
    to/from remote server.

Solution:
    This document describes the process of using FTP to transfer files
    to remote servers from the HP VEE graphical user environment.  This
    is useful when transferring data files collected from instrumentation
    to remote servers for backup purposes.

    The following example was created with HP VEE 4.0 on PC running
    Windows 95. The program is also tested under Windows NT 4.0 and
    should work with other versions of VEE and Windows NT as well.
    Since FTP is an interactive program and usually requires user
    interaction to work, FTP requires use of a script file to auto
    login to the remote server. A simple script file would have the
    following format:

         open hpislsup.lvld.hp.com
         anonymous
         lylec@m2490dmc.nsr.hp.com
         quit

    This entry would open an anonymous FTP connection to
    hpislsup.lvld.hp.com server with my e-mail address as the password.
    The connection would then be immediately terminated with the quit
    command.

    To use this method within the HP VEE environment to automatically
    perform the FTP transactions, there are two methods that can be used.
    The first method would be used when the same procedure, files, and
    commands would be performed for every transaction to a specific server.
    The second method would be to have VEE create the script file
    programmatically. The two methods will be outlined below.

    Method 1:

          Filename: C:FTPSCRIPTSCRIPT1.SCR

          Contents:
             open hpislsup.lvld.hp.com
             anonymous
             lylec@m2476s3m.nsr.hp.com
             cd pub/pc/
             get services.txt
             quit
         
    Method 2:

          -----------------------------------------------
          |  To File:        C:FTPSCRIPTSCRIPT1.SCR   |
          |     X  Clear File At PreRun & Open          |
          |---------------------------------------------|
          |  WRITE TEXT "open hpislsup.lvld.hp.com" EOL |
          |  WRITE TEXT "anonymous" EOL                 |
          |  WRITE TEXT "lylec@m2476s3m.nsr.hp.com" EOL |
          |  WRITE TEXT "cd pub/pc/" EOL                |
          |  WRITE TEXT "get services.txt" EOL          |
          |  WRITE TEXT "quit" EOL                      |
          |_____________________________________________|

    Both methods will perform the same functions. They open the
    connection to hpislsup.lvld.hp.com, login as anonymous with password
    lylec@m2490dmc.nsr.hp.com, change directories to pub/pc, and download
    the file services.txt into the local current directory.

    In addition to the above file, an EXECUTE PROGRAM (PC) will need to
    be called to initiate the FTP connection. Both methods will use the
    same object within VEE as the script is only a file on the harddrive.
    The execute program will have the following format.

          -----------------------------------------------
          |  Run Style:             Normal              |
          |  Wait for prog exit:    Yes                 |
          |  Prog with params:      ftp -s:script1.scr  |
          |  Working directory:     C:FTPSCRIPT        |
          |_____________________________________________|

    The -s: option of the ftp specifies to use the named script as
    the ftp commands. A window will appear for a brief amount of time
    and execute the commands in the script file. The ftp program comes
    standard with the operating system for Windows 95 and NT.

    Using the standard set of FTP commands, the local current
    directory (LCD) could be changed, multiple files (MGET) could be
    retrieved, and transfer mode could be changed to BINARY. Inputs
    could also be added to the VEE object to specify commands and/or
    parameters programmatically.


Revision   1.0         17 Sept 97                        lec
________________________________________________________________________
          Copyright Hewlett-Packard Co. 1996

This information is subject to change without notice and is provided
"as is" with no warranty.  Hewlett-Packard shall not be liable for
any direct, indirect, special, incidental or consequential damages
in connection with the use of this material.



-----Original Message-----
From: Jeff.Davis@motorola.com [mailto:Jeff.Davis@motorola.com]
Sent: Wednesday, February 16, 2000 8:00 AM
To: vrf@lvld.hp.com
Subject: FW: vrf - FTP help?


Question:

I am trying to take upload files to from my Windows NT client to my
webserver that is a Unix machine.  I have an account on the Unix machine
with the proper permissions.  What I would like to know is if anyone out
there can tell me how to use VEE to access this webserver and then transfer
a file(s) from my Client to the Unix account.  I use Cute FTP, or WS_FTP to
do this via Windows.  I am pretty sure that we can do the same thing with
the commandline version of telnet and a batch file, but would like some
advice or suggestions.

Thanks in advance,


--------------------------------------------
Jeff Davis
Motorola SSTG
8201 E. McDowell Road
Scottsdale, AZ 85257
PH: 480-441-2178          FAX: 480-441-2617
CELL: 602-316-6121     PAGER: 602-201-5449
--------------------------------------------
...---...

---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo.  To send messages to
this maillist, just email to "vrf@lvld.hp.com".  Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.hp.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.hp.com".
---------------------------------------------------------------------

---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo.  To send messages to
this maillist, just email to "vrf@lvld.hp.com".  Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.hp.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.hp.com".
---------------------------------------------------------------------

Outcomes