cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: -O and Content-Type: application/octetstream

From: Ralph Mitchell <rmitchell_at_eds.com>
Date: Fri, 29 Aug 2003 00:54:51 -0500

Umm, OK... you might want to try splitting the line up into its
component parts:

    curl -b 'SephCookie' -c 'SephCookie' -L
'http://SephSite.com/SephDir/login.php?login=123456789&pass=MiPass'

    curl -b 'SephCookie' -c 'SephCookie' -o 'SephFile2me'
'https://SephSite.com/SephDir/action.php?choix=2&Annee=2003&action=Excel'

The first one would be doing the login and getting back cookies. The
second would hand back the cookies and fetch the file. While it might
be possible to make it work all in one line, I've found it easier to
make several calls so that I know exactly what's going on.

Ralph

Laurent Demaret wrote:

> Hello Ralph,
>
> I have tried -o with a file name already, my command line is
> getting quite long now ;-/ :
>
> curl --trace-ascii 'FSEcURL.trace' -D 'DH_Curl4Seph' -b 'SephCookie'
> -c 'SephCookie' -e -L
> 'http://SephSite.com/SephDir/login.php?login=123456789&pass=MiPass'
> -b 'SephCookie' -c 'SephCookie' -o 'SephFile2me'
> 'https://SephSite.com/SephDir/
> action.php?choix=2&Annee=2003&action=Excel'
>
> So, I get a FSEcURL.trace file that says that :
>
>
>
>> <= Recv header, 71 bytes (0x47)
>> 0000: Server: Apache/1.3.14 (Unix) PHP/4.0.3pl1 mod_ssl/2.7.1 OpenSSL/
>> 0040: 0.9.6
>> <= Recv header, 28 bytes (0x1c)
>> 0000: X-Powered-By: PHP/4.0.3pl1
>> <= Recv header, 12 bytes (0xc)
>> 0000: Expires: 0
>> <= Recv header, 17 bytes (0x11)
>> 0000: Cache-Control:
>> <= Recv header, 10 bytes (0xa)
>> 0000: Pragma:
>> <= Recv header, 47 bytes (0x2f)
>> 0000: Content-disposition: filename=FSE_de_2003.csv
>> <= Recv header, 28 bytes (0x1c)
>> 0000: Transfer-Encoding: chunked
>> <= Recv header, 39 bytes (0x27)
>> 0000: Content-Type: application/octetstream
>> <= Recv data, 3786 bytes (0xeca)
>
>
> But it goes in the terminal window, not in "SephFile2me" as expected,
> sometimes it does create such a file but it's empty.
>
>> 0000: ec3
>> 0005: Date FSE,N.FSE,N.LOT,Libell.,Organisme,Montant total,Montant ava
>> 0045: nc.,Montant rembours.,Montant d.,Mode de paiement,Etat FSE
>> 0081: 28/02/2003,013059046,564,ROUSSEAU TONY,MAUBEUGE,47.55,47.55,47.
>> 00c1: 55,0,,Pay.
>> 00cd: 31/03/2003,013090047,564,ROUSSEAU TONY,MAUBEUGE,226.86,226.86,2
>> 010d: 26.86,0,,Pay.
>> 011c: 28/05/2003,013148079,515,MAITTE CLAUDE,MAUBEUGE,43.62,43.62,43.
>> 015c: 62,0,,Pay.
>> 0168: 28/05/2003,013148080,515,MAITTE CLAUDE,MAUBEUGE,86.75,86.75,86.
>> 01a8: 75,0,,Pay.
>> 01b4: 29/05/2003,013149081,516,GHOMARI YAMINA,MAUBEUGE,26.54,0,0,0,CH
>> 01f4: EQUE,ARL positif re.u
>> 020b: 30/05/2003,013150082,515,KADI MOHAND,MAUBEUGE,191.09,191.09,191
>> 024b: .09,0,,Pay.
>
> #Cut here# ..
>
> Le jeudi, 28 aoû 2003, à 18:37 Europe/Paris, Ralph Mitchell a écrit :
>
>> You'd want to do that with a lowercase O:
>>
>> -o filename
>>
>>

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-08-29