Re: ftp transfer using apple script (using URL Access)
Re: ftp transfer using apple script (using URL Access)
- Subject: Re: ftp transfer using apple script (using URL Access)
- From: Jolly Roger <email@hidden>
- Date: Tue, 19 Jun 2001 10:17:04 -0500
On 6/19/2001 9:10 AM, "g_vkatta" <email@hidden> wrote:
>
hi!
>
>
can any one help me with the script that tells "Fetch"(used for FTP transfer)
>
to transfer the files,"Fetch" should by default take the username and password
>
and should transfer the files from the path mentioned to the destination path!
>
>
if not with fetch ,please provide me with any hint so that my script will be
>
usefull in transferring the files.I am planning to save the script as
>
"classing applet" with "stay open" option.
I use URL Access Scripting, because it allows you to transfer files
transparently in the background. Here's a sample script:
-- begin script
property FTPfilename : "test.html"
property FTPusername : "username"
property FTPpassword : "password"
property FTPhost : "www.domain.com"
property FTPpath : "pub/incoming/"
set filePath to (path to startup disk as text) & "Desktop Folder:" &
FTPfilename
set myURL to "
ftp://" & FTPusername & ":" & FTPpassword & "@" & FTPhost &
"/" & FTPpath & FTPfilename
log filePath
log myURL
try
-- try connecting for 5 minutes
with timeout of 300 seconds
tell application "URL Access Scripting"
upload filePath to myURL replacing yes without binhexing
quit
end tell
end timeout
on error the errmsg number errnum
tell application "URL Access Scripting" to quit
if the errnum is not -128 then
tell application (path to frontmost application as text)
beep
display dialog "URL Access Scripting error: " & the errmsg
buttons {"OK"} default button 1
end tell
end if
end try
-- end script
HTH
JR