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

Help with FTP 2

Status
Not open for further replies.

LUEBBKEVIN

Programmer
Apr 30, 2002
35
US
I need to send files and receive files from a server via FTP in a program(s). What would be the required parameters I need for the CLP?
I've found a few FTP references in other CLPs and it appears that they are using an ftp command file and a log file. How do I know what to use in the command file?
Any help or links to reference materials would be great.
 
If you type "ftp localhost" on a command line you will start an FTP connection to your local machine. Then at the ftp prompt, type "help" and the 400 will provide a list of ftp commands.

You can then use these commands in an ftp script file that you will use in a CL. Sorry, it's been a while since I did it and I do not have an example in front of me now. I will try to find one for you.

Oh, to quit the ftp connection, type "quit".
 
Thanks for the help. That website got me started. Is there a way to change the folder where I'm putting the file on the server? Right now I put the file from the 400 into the root of the server and I need it to go to a specific folder.
 
I presume that you are running this on the AS/400. (The command examples are from the AS/400 to your server)

In your command file, you can enter a cd command.
This changes the current directory on the server to whatever you enter.

cd "somefolderonSever"

Conversely, you can enter a lcd command and this will change the working directory on the local machine.

lcd "somelibraryonAS400"

or if you don't like adding the additional command(s), you can always specify the location in your put or get commands

put \somelibrary\file \somefolder\file
or
get \somefolder\file \somelibrary\file

In my application, I have choosen to include the location in the put command. The remote and local file locations are passed to the progam that builds the command file. So far it has worked great.

Glenn Bruckner
 
Does anyone have a complete listing of the FTP return codes? like 331 is something like password required. I have what appears to be a very basic list but there are a lot of gaps in the numbering and I was curious as to what those missing codes represent.
 
I've got several ftp scripts written that run in batch mode. What are you trying to do?

RedMage 1967
IBM Certified - RPG IV Programmer
 
To change the directory on the remote server, issue the FTP subcommand:

cd <remote_directory>

To change the destination library on the AS/400:

lcd <library>

&quot;Don't worry about the world coming to an end today. It's already tomorrow in Australia.&quot;
--Charles Schultz

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top