Re: "mount disk" and ftp problem
Re: "mount disk" and ftp problem
- Subject: Re: "mount disk" and ftp problem
- From: Gnarlodious <email@hidden>
- Date: Tue, 07 Oct 2003 09:12:32 -0600
I don't know what archive you are using but here is the best:
http://digiprint.hldns.com/applescript/
Sounds like you need Dan Shockley's script SimpleFTPUpload:
Well, I can't find a URL but it looks like this
set userName to "CogentR"
set userPasswd to "censored"
simpleFtpUpload("
ftp://ftp.MacOSphere.com/Sites/Gnarlodious/", bLinksPath as
text, userName, userPasswd)
on simpleFtpUpload(remoteURL, macFilePath, userName, userPasswd)
-- version 1.2, Dan Shockley (
http://www.danshockley.com)
-- uses curl to do the upload
-- remoteURL is the complete ftp url to the remote destination directory
try
if userName is "" then
set userName to "anonymous"
set userPasswd to "email@hidden"
-- no email address, change if desired
end if
-- get parentFolder
if (macFilePath as string) ends with ":" then -- it is a folder
itself
set {od, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, ":"}
set parentFolder to (text items 1 thru -3 of (macFilePath as
string)) as string
set AppleScript's text item delimiters to od
else -- it is just a file
set {od, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, ":"}
set parentFolder to (text items 1 thru -2 of (macFilePath as
string)) as string
set AppleScript's text item delimiters to od
end if
set localPosixPath to quoted form of POSIX path of alias macFilePath
set uploadFileName to do shell script "basename " & localPosixPath
set uploadDirectory to quoted form of POSIX path of parentFolder
-- curl --upload-file SOMEFILE
ftp://SERVER.com --user
MYUSER:THEPASSWD
-- must be IN the directory of the file you want to upload
set myCommand to "cd " & uploadDirectory & ";" & "curl --upload-file
"
set myCommand to myCommand & quoted form of uploadFileName
set myCommand to myCommand & " " & remoteURL
set myCommand to myCommand & " --user " & userName & ":" &
userPasswd
set myCommand to myCommand & " " & "--write-out " & "%{size_upload}"
set myCommand to myCommand & " --quote -quit"
-- output is the 'size_upload' result from curl
set uploadResult to do shell script myCommand
return uploadResult -- size uploaded in kilobytes
on error errMsg number errNum
--dispay dialog
error "simpleFtpUpload FAILED: " & errMsg number errNum
end try
end simpleFtpUpload
Entity Steve Thompson spoke thus:
>
On Tuesday, October 7, 2003, at 02:57 PM, Ron Bishop wrote:
>
>
> There are numerous GUI applications and CLI applications.
>
>
I don't want use a third party application on an OS X box with built in
>
FTP, but thanks for the suggestion. It's just another thing that can go
>
wrong!
>
>
>
On Tuesday, October 7, 2003, at 02:48 PM, Joshua See wrote:
>
>
> Use cURL, see the list archives.
>
>
I've been trying to search the archives for some answers for about 3
>
hours now, but it keeps timing out. I don't know if it's down or if my
>
firewall is playing up or something. Could you give me a clue? I assume
>
you're just saying that I construct a string "curl " & dest & filename
>
kind-of-thing and then execute it as a shell script?
>
>
Thanks,
_______________________________________________
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.