Re: Downloading a file from the internet with a URL
Re: Downloading a file from the internet with a URL
- Subject: Re: Downloading a file from the internet with a URL
- From: Doug McNutt <email@hidden>
- Date: Thu, 12 May 2016 16:14:36 -0400
The -O option asks curl to make up a name from the URL and store it in
the current working directory
The -o option expects to be followed by a directory and a name. The
directory defaults to the current directory.
It appears that Apple is not cooperating. Surprised?? Here's what I got
using a -V for "be verbose as you go"
[~]> curl -V -O "http://support.apple.com/kb/HT1582?viewlocale=fr_FR";
curl 7.43.0 (x86_64-pc-linux-gnu) libcurl/7.43.0 GnuTLS/3.3.15
zlib/1.2.8 libidn/1.28 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps
pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM
NTLM_WB SSL libz TLS-SRP UnixSockets
Those lines may represent all the schemes that were tried but whonoze?
You might need to use the -A option to swear that you really are a browser.
From the man page:
-A, --user-agent <agent string>
(HTTP) Specify the User-Agent string to send to the HTTP server.
Some badly done CGIs fail if this field isn't set to "Mozilla/4.0".
To encode blanks in the string, surround the string with single
quote marks. This can also be set with the -H, --header option of
course.
On 05/12/2016 03:25 PM, Stockly, Ed wrote:
OK, this any idea why this doesn't work?
I've tried it with and without making a file before trying to download.
Not sure about the –o and –O options.
______
*set* fileToDownload *to* quoted form *of*
("http://support.apple.com/kb/HT1582?viewlocale=fr_FR";)
*set* filePath*to* (*choose file name*)
*set* openFile*to* *open for access*filePath*with* write permission
*close access*openFile
*set* filePath*to* POSIX path*of* filePath
*set* myFile *to* quoted form *of* (filePath *as* /text/)
*set* XMLbrut *to* *do shell script* "curl -o " & filePath & " " &
fileToDownload
*set* myFile *to* quoted form *of* ((filePath *as* /text/) & -1)
*set* XMLbrut *to* *do shell script* "curl -O " & filePath & " " &
fileToDownload
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden