Link to home
Start Free TrialLog in
Avatar of cbones
cbonesFlag for United States of America

asked on

File to ftp with a prompt for file name

Hello,

I was wondering if there can be an ftp script (batch file or vbscript) that runs and logs into a server, changes to a certain directory and then prompts the user for a file name to enter.  The file name that the user enters will be the file that gets copied (ftp) to their local machine.

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cbones

ASKER

I tried the above but it doesn't open an ftp session.
Avatar of Bill Prew
Bill Prew

What did it display?
 
~bp
Avatar of cbones

ASKER

It asks for a file name to transfer:

"Please enter filename to transfer:test.doc"

c:\>open 172.168.1.10 'open is not recognized as an internal or external command,
operable program or batch file

c:\>user

It also returned a windows error that I attached to this post.
Are you sure you copied it and modified it correctly, I just tried it here and it seems to run the FTP program.

~bp
Avatar of cbones

ASKER

It doesn't work on my Windows 7 machine.  I tried it on a windows xp and it keeps prompting me for the password.  I have tried with the password in the file and without the password in the file.  I receive the message "invalid command" after typing in my password.
So it seems that it works on windows xp but I can't get past this message.
You may have to play around with the FTP subcommands a bit, depending on the FTP server that you you are connecting to.  Different FTP server implementation can require slightly different approaches to connecting and authenticating.

What FTP server software are you using on the host server?

~bp
Avatar of cbones

ASKER

I had to remove the password field in the bat file.  Once I removed the password field it now allows me to type in my password and transfers the file.  I am trying to get the password stored in the field.  It is a unix machine.

Thank you.
Avatar of cbones

ASKER

Any reason why this wouldn't work from a Windows 7 machine?
No reason it shouldn't work on win7.

Try removing the word "user" from the second line of the section we send to FTP, that might not be needed for you FTP server.

~bp