View Full Version : FTPing a save file
Guest.Visitor
01-01-1995, 02:00 AM
How do I FTP a save file to the AS/400? I've done it before, but it's been a while. I'll tell you what I'm doing and you can fill in what I'm messing up/missing: Open MS/DOS session on the PC. CD C: (the file on my PC is in crive C:) ftp (AS/400 IP address) signon with username and password CD MyLib (sets my library to current lib) Binary Put filename When I do that, I get a Physical File on the 400 that I can't restore. I think I remember having to create the savefile on the 400 first, but when I do that in my library, it tells me it can't write to that file when I do the FTP. Any suggestions? Keith
Guest.Visitor
02-09-2000, 02:33 PM
Keith, Funny you should ask. I was just going over this with someone else. The change you should make is to first create an empty savf on the as/400. Then you do the put like in your example and all is well. Example 1. create empty savf on as/400 CRTSAVF MYLIB/MYSAVF 2. Assume the savf on your pc is c: mpmysavf.sav. Make an ftp connection from your pc to the as/400 and type the following commands: ftp>bin ftp>put c: mpmysavf.sav mylib/mysavf ftp>quit Thats it. You really had all the pieces except step 1 above. Alex Garrison
Guest.Visitor
02-09-2000, 02:38 PM
Keith, Whoops. I didnt read the last sentence of your posting before I responded. "I think I remember having to create the savefile on the 400 first, but when I do that in my library, it tells me it can't write to that file when I do the FTP. Any suggestions?" Yep that is all you have to do. I dont know why you cant ftp the savf to the as/400. I do this almost weekly and it never fails. Maybe someone else knows why it doesnt work for you. Alex Garrison
Guest.Visitor
02-09-2000, 02:47 PM
The name of the file on my PC is "cleanup". I create a savefile also named "cleanup" When I execute the command "put cleanup" (without the quotes of course) I get a messages saying the data transfer has begun, then that the connection has been reset by peer, then that opereation has terminated after some small number of bits have been transferred, then a final message saying "cannot write to file cleanup member cleanup". When I put other files, it doesn;t give me that message, it just transfers the data nice and happily. So the two messages I get different are that the connection is reset (I'm not kicked off the 400 though) and the one about not being able to write to the file. This suggest anything to you? My next step is to find out the IP of my PC and try FTPing to it from the 400 and doing a get. Thin, very thin. Positively anorexic. But I can't think of anything else. Thanks for the help. Keith
Guest.Visitor
02-10-2000, 04:29 AM
Kieth, I use a script that I pass to a one line batch program. The batch program simply executes ftp -s: which identifies the script file. I a shortcut to the batch file on my desktop. Depending on the command shell you may have to use DOS names when specifying the script file. For example: ftp -s:D:FTPSCR~1DMCFTP~1.TXT Prior to running this batch file, I put my save file in a directory called d: ransfer and specify .savf for the extension. The script file which is D:FTPSCR~1DMCFTP~1.TXT in this case contains the following lines: lcd d: ransfer open mysys myprofile mypassword quote site namefmt 1 bin After this script is run, I will be at a prompt and simply enter: put savfilnam.savf quit The first of the script sets the local transfer from directory. The next line connects to my AS/400. Then next two lines enter my profile and password (don't tell anyone) the next line sets naming to the system naming convention which makes it so that .savf transfers to a save file rather than a data base file. Bin is transfer as binary. David Morris
Guest.Visitor
02-10-2000, 05:08 AM
I beleive you need to specify .savf in your put statement so the AS/400 knows to create a savefile. put filea filea.savf
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.