Re: FTP Upload
Re: FTP Upload
- Subject: Re: FTP Upload
- From: Jay Louvion <email@hidden>
- Date: Sat, 28 Jan 2006 13:22:44 +0100
Title: Re: FTP Upload
Use the curl shell (I do and it works great), but specify –u, so that you can pass on your ftp usrname and psswd. Also, I would simplify the repeat loop thus:
set ftp_path to ""
set ftp_name to "username"
set ftp_pw to "password"
set ftp_server to "ftp.dummy.com"
on adding folder items to this_folder after receiving these_files
repeat with this_file in these_files
set thisPOSIXfile to quoted form of POSIX path of this_file
set shellscript to "curl -u " & ftp_name & ":" & ftp_pw & " -T " & thisPOSIXfile & " " & ¬
ftp_server & ""
do shell script shellscript
do shell script "rm " & thisPOSIXfile -- careful, rm (for remove, or delete) is very useful but cannot be undone. Can be replaced by “Tell application “finder” to move this_file to the trash” (which you will be able to retrieve or empty later.
end repeat
end adding folder items to
Not knowing how your path works, the above script only uploads to the root dir of your ftp server. You’ll have to correct it a bit.
HTH,
J.
On 28/1/06 11:44, "Alexander Thiel" <email@hidden> wrote:
Hi everyone,
I try to do a folder action, which uploads every file to a ftp-server, even if the files are in nested folders, after upload the files should be deleted. I did several tests with "URL Access Scripting", and with "curl" but I wasn't succesfull :(
Could you give me hint, how I could handle this?
Alex
set ftp_path to ""
set ftp_name to "username"
set ftp_pw to "password"
set ftp_server to "ftp.dummy.com"
set ftp_connection to "ftp:///" & ftp_name & ":" & ftp_pw & "@" & ftp_server & ftp_path
on adding folder items to this_folder after receiving these_files
tell application "URL Access Scripting"
try
repeat with i from 1 to number of items in these_files
set this_file to item i of these_files
upload this_file to ftp_connection
--do shell script "curl -t " & this_item & "'ftp_connection'"
end repeat
end try
end tell
tell application "Finder"
set the target_file to (delete this_file)
-- PROCESS THE ITEM
process_item(target_file)
end tell
end adding folder items to
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
skypeme:
jaylouvion
www.studiocasagrande.com
P Please consider the environment before printing this email.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >FTP Upload (From: Alexander Thiel <email@hidden>) |