curl-users
-O and Content-Type: application/octetstream
Date: Thu, 28 Aug 2003 17:33:49 +0200
Hi,
Another thing I tried unsuccessful : put the result of the request in
a file instead printing on the screen. I tried first with -O as the
server give a name to this file constructed with its data. But it did
not match and I got hundreds of lines "comma separated values". It
seems that the server send an answer in an html file and appends a file
with it.
Here is the trace log from lynx :
> Writing:
> GET /Directory/action.php?choix=2&Annee=2003&action=Excel HTTP/1.0
>
> Host: My.host.com
>
> Accept: text/html, text/plain, text/sgml, */*;q=0.01
>
> Accept-Encoding: gzip, compress
>
> Accept-Language: en
>
> User-Agent: Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6i
>
> Referer: https://MySite.com/Directory/action.php
>
> Cookie2: $Version="1"
>
> Cookie: PHPSESSID=28764378c8cfad9c8865378111fd8ba9
>
>
>
> ----------------------------------
> envoi requete HTTP
> HTTP: WRITE delivered OK
> Demande achemine au serveur. Veuillez attendre
> HTTP: Trying to read 1535
> HTTP: Read 1535
> Lecture de 1.5 KB kilooctets de donnÈes, 514 bytes/sec.
> HTTP: Rx: HTTP/1.1 200 OK
> HTTP: Scanned 2 fields from line_buffer
Here are the two files ?
> --- Talking HTTP1.
> HTTP/1.1 200 OK
> HTFormat: Constructing stream stack for www/mime to www/present
> HTFormat: Looking up presentation for www/mime to www/present
> StreamStack: found weak wildcard match: www/present
> FindPresentation: found exact match: www/mime
> StreamStack: found exact match: www/mime
> StreamStack: Returning "MIMEParser"
> HTMIME: Date: Tue, 26 Aug 2003 18:51:12 GMT
>
> Server: Apache/1.3.14 (Unix) PHP/4.0.3pl1 mod_ssl/2.7.1 OpenSSL/0.9.6
>
> X-Powered-By: PHP/4.0.3pl1
>
> Expires: 0
>
> Cache-Control:
>
> Pragma:
>
> Content-disposition: filename=FSE_de_2003.csv
>
> Connection: close
>
> Content-Type: application/octetstream
That 's the data I would like to get in a file :
>
> Date FSE,N∞FSE,N∞LOT,LibellÈ,Organisme,Montant total,Montant
> avancÈ,Montant remboursÈ,Montant d˚,Mode de paiement,Etat FSE
>
> 28/02/2003,013059046,564,ROUSSEAU
> TONY,MAUBEUGE,47.55,47.55,0,47.55,,ARL positif reÁu
>
> 31/03/2003,013090047,564,ROUSSEAU
> TONY,MAUBEUGE,226.86,226.86,0,226.86,,ARL positif reÁu
Is it possible to do that with cURL ?
TIA
Laurent Demaret
-- laurent.demaretATfree.fr ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sfReceived on 2003-08-28