|
#1
| |||
| |||
| Example of how to upload a file using AppleScript & UNIX Shell? Is using "do shell script" and cURL really a better way to upload a file than URL Access Scripting? If so, can somebody give me a simple example of how to upload a small text file with this method?
__________________ Mac Pro [2 GHz Quad Xeon, 3 GB RAM, 3 x 250 GB drives] MacBook [2 GHz Intel Core 2 Duo, 2 GB RAM, 80 GB drive] |
|
#2
| ||||
| ||||
| simple example for ftp: curl --upload-file foo.txt ftp://some.server/some/folder/ You can also add options like --user username:password As always, rtfm.
__________________ What is the robbing of a bank compared to the founding of a bank? -- Bertold Brecht Last edited by scruffy; August 7th, 2004 at 03:58 PM. Reason: no I really did mean : followed by p, not a smiley |
|
#3
| |||
| |||
| So instead of doing this: Code: tell application "URL Access Scripting"
upload file.txt to "ftp://login:password@server.com replacing yes without binhexing
end tell Code: curl --upload-file file.txt --user login:password ftp://server.com Thanks for your help.
__________________ Mac Pro [2 GHz Quad Xeon, 3 GB RAM, 3 x 250 GB drives] MacBook [2 GHz Intel Core 2 Duo, 2 GB RAM, 80 GB drive] |
|
#4
| ||||
| ||||
| Sorry, I just meant the curl manpage - lots and lots of useful options (how to use proxies, upload http forms, etc. etc.) The only manual for applescript I have is the one that came with the developer tools cd - it's installed at /developer/documentation/applescript. I don't know about how to wrap that into applescript. I'd just write a shell script and run it in the terminal, cuz that's what I know how to do...
__________________ What is the robbing of a bank compared to the founding of a bank? -- Bertold Brecht |
|
#5
| |||
| |||
| do shell script "curl --upload-file file.txt --user login:password ftp://server.com" |
![]() |
| Thread Tools | |
|
|