automating uploading of new files in a folder to another

Hi all,

I’m completely new to applescript, and have a question about the difficulty level for a script that satisfies my need. I’d like to automate the uploading of new files that occur in a directory to a certain ftp site.

For example, any new or changed file in my ~/Sites/test directory should automatically upload to ftp://mysite.com.

I’m aware that os x finder is read-only for ftp, so I’m hoping that this can be accomplished by somehow combining the use of folder actions and cmd line ftp.

Can this be done? How easily?

thank you
MP

How easily can it be done? Very:

tell application "URL Access Scripting"
	upload file "path:to:file.txt" to "ftp://username:password@ftp.server.net/directory/"
end tell

You’ll need to add the logic to work out which files are ‘new’, but this is easily done, and is automatic if you set this script up as a Folder Action.

Why am I getting parameter error with this?

“URL Access Scripting got an error: Parameter error.”

Jukka

I assume you changed the script to point to a real file on your disk, and a real FTP server you can upload to, right?

Yes I changed. :smiley:

There was a topic that say it wont work in Panther. Are You using this on Panther?
http://bbs.applescript.net/viewtopic.php?t=5976
There was also a tip to use curl and that worked for me.

Thanks.

Jukka