Re: URL Access Scripting?
Re: URL Access Scripting?
- Subject: Re: URL Access Scripting?
- From: JJ <email@hidden>
- Date: Thu, 28 Feb 2002 21:49:20 +0100
>
--- begin script
>
>
-- UserName: "ehost"
>
-- PassWord: "abc123"
>
-- HostAddress: "64.70.132.229"
>
>
-- an alias reference to the uploadable file
>
set this_file to choose file
>
-- the FTP URL of the receiving directory
>
set this_URL to "ftp://ehost:email@hidden/"
-- this is a directory. so, you should upload a directory, not a file.
-- to upload a file:
-- set this_URL to "
ftp://ehost:email@hidden/uploaded_file.html"
>
try
>
-- try connecting for 5 minutes
>
with timeout of 300 seconds
>
tell application "URL Access Scripting"
>
upload this_file to this_URL with progress
-- if this_file exists in the remote ftp server, you should consider using
"replacing yes/no"
>
quit
>
end tell
>
end timeout
>
on error the error_message number error_number
>
tell application "URL Access Scripting" to quit
>
if the error_number is not -128 then
>
tell application (path to frontmost application as text)
>
beep
>
display dialog the error_message buttons {"Cancel"} default button 1
>
end tell
>
end if
>
end try
>
>
-- end script
However, some servers do not "understand" URL Access Scripting commands or
files are "chmoded" with special orders (i. e., www.geocities.com doesn't
allow direct u/l nor d/l).
In this case, you can do a "download with directory listing", so you are now
"joined" into the server and you can d/l-u/l files.
set list_URL to "
ftp://user:email@hidden//user/"
set upl_URL to "
ftp://user:email@hidden//user/upload_file.sit"
tell application "AppleScript para URL"
download list_URL to (new file) replacing yes with directory listing and
progress
upload (choose file) to upl_URL replacing yes with progress
quit
end tell
JJ
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.