OS X, FTP Command Line Options

4 posts / 0 new
Last post
BDub's picture
Offline
Last seen: 2 years 7 months ago
Joined: Dec 20 2003 - 10:38
Posts: 703
OS X, FTP Command Line Options

Hey -

I'm trying to create an Applescript for OS X that'll allow a user to drop a file onto it, then the script will log onto my FTP server, give username and password, and upload the file, then log out. Basically, it's to save some clients from having to use an FTP client.

I know I can give commands in this format

ftp user@servername.com:command:command:quit

What I want to know is how to include the password with that? I can make the line work properly, except that it prompts me for a password each time. I'd rather not do that, if at all possible.

Jon
Jon's picture
Offline
Last seen: 13 years 4 months ago
Joined: Dec 20 2003 - 10:38
Posts: 2804
IIRC the URL standard for inc

IIRC the URL standard for including a pw is something like:

ftp user:passwd@site.com

Yep, it's right there on the man page for ftp. I dunno if it works like that through AppleScript, but it would work quite well in a bash/tcsh/etc script.

BDub's picture
Offline
Last seen: 2 years 7 months ago
Joined: Dec 20 2003 - 10:38
Posts: 703
Hmmm...tried that and it refu

Hmmm...tried that and it refused, even from terminal. Perhaps it's something odd with my FTP server itself. Let me try it out on another few I have passwords for, and see if it works.

Jon
Jon's picture
Offline
Last seen: 13 years 4 months ago
Joined: Dec 20 2003 - 10:38
Posts: 2804
You might try enclosing some

You might try enclosing some of the funky parts with quotes to protect it from the shell trying decode it into commands:

ftp "user:passwd@site.com"

I know I have to use that trick when I want curl to work right on a multiple file grab:

curl "http://www.site.com/files/image[001-150].jpg" -O

and some other fun things.

Log in or register to post comments