FTP Upload Multiple Files to Multiple Sites

I’ve search the forum quite a bit but have not been able to find a scenario like this. I need to automate Ftp uploads where I have several files that need to be uploaded to many different sites. The password/user id are the same for all sites.

I am not sure if a CSV file can be used for the list of urls and corresponding files since the list has to point to local files to be uploaded. Maybe this is a job for Ruby or Perl that can easily parse CSV. Or, there may be a stand-alone program to handle this situation. I’d appreciate some direction in this venture. THanks.

Hi,

FTP upload can be easily done with the shell curl command
and you can parse CSV files or other sources also with AppleScript

Stephan,

As always, thank you. I have to now take a look at curl since this is new to me. Any curl examples that you can point to which may get me started? Appreciated.

something like this


property ftpserverPath : "[url=ftp://ftp.myServer.com/path/to/folder/]ftp.myServer.com/path/to/folder/[/url]"
property user_name : "user"
property pass_word : "pass"
property theFile : "myFile.xyz"

set sourceFile to ((path to desktop as text) & theFile)
set serverURL to ftpserverPath & theFile
curl_upload(POSIX path of sourceFile, serverURL)

on curl_upload(_source, _destination)
	do shell script "curl " & quoted form of _destination & " -u " & user_name & ":" & pass_word & " -T " & quoted form of _source
end curl_upload