curl-users
Re: upload to browser
Date: Tue, 22 Feb 2005 06:58:31 -0600
You may be stuck with setting up a man-in-the-middle script - use your
browser to fire up a cgi script that submits the images then hands
back the session cookies and a Redirect to your browser when it's
finished.
I suppose something like this might work, though I've never tried it:
for n in list-of-images
do
curl -b cookies -c cookies .......
done
cookie=`grep PHPSESSID cookies`
set $cookie
echo "HTTP/1.1 302 Object Moved"
echo "Set-Cookie: $6=$7; path=$3"
echo "Location: http://www.order.proprint.se/
or something along those lines. That way, your session cookie doesn't
have to be in the browser's cookies file at all, it just gets passed
through once the script finishes the upload.
Ralph
On Tue, 22 Feb 2005 13:34:12 +0100, Magnus Stålnacke <jemamo_at_telia.com> wrote:
> Ralph Mitchell wrote:
>
> >Actually, there *is* a number in the cookie file that represents the
> >expiry date - it's the 5th field, and it's given in seconds since the
> >Epoch.
> >
> >
>
> Ahh, should have guessed that, std unix time.
>
> Well anyway, now i have compared what curl vs mozilla
> saves in the cookie file, visiting the same adress.. it is not
> the same. Mozilla does not save the sessioncookie in the
> cookie file (the phpsessid, see below).
>
> I started with an empty cookies.txt, then pointed mozilla
> at www.order.proprint.se, after that the file had following:
>
> www.order.proprint.se FALSE / FALSE 1109159434
> CookieValue 1
>
> Only one line in the cookiefile, but the mozilla cookie-manager
> said there where two cookies (that coresponds to what curl does).
>
> Then i emptied the file and pointed curl at the same adress
> and saved the cookie with the -c option, curl saved two lines:
>
> www.order.proprint.se FALSE / FALSE 0 PHPSESSID
> 2db45874b03f7240ff96c447bb613a3e
>
> www.order.proprint.se FALSE / FALSE 1109159853
> CookieValue 1
>
> If i have mozilla allredy started when i write the above
> cookies with curl, and then visit the adress, mozilla
> deletes the "phpsessid" cookie, and gets a new one that
> probably not is stored in any file. I also tried to change
> the "0" to a future time, did not help, mozilla deleted it
> anyway and stored a new "phpsessid" in memmory.
>
> --
> Software is not manufactured, it is something you write and publish.
> Keep Europe free from software patents, we do not want censorship
> by patent law on written works.
>
>
Received on 2005-02-22