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!

FTP with dial up server

Status
Not open for further replies.

ricknav

Programmer
Oct 15, 2003
1
US
Can anyone share or reference an aspect script for connecting to a dial-up ftp server which might also involve logging in with name/password and uploading/downloading files. Most needed is a sample of dialing the phone number then issuing the ftp commands once connected.
A manual process for this might involve setting up a Dial-Up-Network connection in FTP, connecting, then going to a dos prompt and executing the ftp commands. If possible, I'd like to script everything.
Thanks
 
Calling rasphone.exe with the correct parameters can initiate a dial-up networking connection on Win2K and I believe XP (don't have a machine handy to see if that exact executable exists on the machine). I have an FTP script on my site that shows some of the basics with scripting an FTP connection in Procomm, but it wasn't applicable to the original poster's environment (he sent me an email at the same time, but I don't recall the exact details).

If you have any more questions regarding FTP, feel free to ask.


aspect@aspectscripting.com
 
I am running Windows XP and rasphone and rasdial both work. I decided to use rasdial, as I can pass the username and password and keep the user from having to enter anything.

My question is, I am trying to connect to a FTP Server using a specific IP address and port number. This requires a username and password. I used the command for userid and password, but it stills tries to do it anonymously and fails. I even turned off anonymously login.

Any helped would be very much appreciated.
 
I use procedures to put my scripts together, below is what I hope you are looking for:


;
; Select FTP Mode and Login into MA Blue Shield FTP Server
;
sFTPOPEN="MABS"

menuselect PWMENU 322

ftp local chdir sACCRPT

accLOGIN ()

#ifdef DEBUG
sDLGTITLE = "Debug Script Message"
sDLGTEXT = "Successfully Connected to MA BS FTP Server"

sdlgmsgbox sDLGTITLE sDLGTEXT INFORMATION OKCANCEL iRETVAL

if iRETVAL == 2
pwexit
endif
#endif

set dialentry anonymouslogon OFF
set userid sYLOGIN
set password sYPWORD

dial FTP sFTPOPEN
while $FTPSTATUS
yield
endwhile
 
I'm about to run off for lunch, but have you checked the Connection Directory entry to make sure the changes for that entry were saved? I suspect you will need to add a dialsave command after you've modified the username and password.


aspect@aspectscripting.com
 
I tried that and in fact here is the code

sFTPOPEN="MABS"

menuselect PWMENU 322

ftp local chdir sACCRPT

accLOGIN ()

dialload sFTPOPEN
set dialentry anonymouslogon OFF
set userid sYLOGIN
set password sYPWORD
dialsave

It did not save the username and password when I ran the script and then looked at the connection directory afterwards.
 
You need to add a line similar to this to your script:

set dialentry access FTP sName

where sName is a string variable containing the name of the Connection Directory entry to access so that the script knows which entry to modify with the following set commands.

You may also need to modify the value of the Connection Directory name in sFTPOPEN to include the .dir extension. I was unable to load a Connection Directory without specifying the .dir extension for some reason, even though the help file says it's OK to omit the extension if it's .dir.

aspect@aspectscripting.com
 
knob,

Thank you for your help to date, sorry for not thanking you earlier. I had a customer install to get ready for and then the actual install.

I have been able to dial and login into the remote FTP Server; however, it tries to do a 'list' command to the remote site, which causes me to disconnect. How can I stop this?
 
There is no way to avoid the list command, but usually when a disconnect occurs like this it is due to something being in the remote filters field. Try clearing the Remote files field out (select the Options | FTP Options | Folder options menu field) and see if that takes care of the problem.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top