curl-and-php
Re: Curl + Php + Orkut
Date: Tue, 24 Jun 2008 13:55:24 -0600
you'll want to add a header like this:
$campos["Content-Length"] = filesize($arquivo);
Buena suerte ;)
- Dan
Elias Rezende wrote:
> Good afternoon.
> My name is Elias.
> I'm trying to develop an application in PHP to send a picture to a
> particular album on Orkut.
> We have managed to access orkut, authenticate, select the album for
> which IŽll send the photo.
> Only not to upload.
> One message says: POST requests require a content-length header.
>
> The code is:
>
> $campos[$campo] = "@".$arquivo;
> $campos["POST_TOKEN"] = "C9C1D56D6E4580D2073A1F1B829856A6";
> $campos["signature"] = "CqgAr5eSvAzQ2A/h21nrH6OSYAY=";
> $campos["Action.upload"] = "";
>
>
> curl_setopt($ch, CURLOPT_URL, $url);
> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
> curl_setopt($ch, CURLOPT_COOKIE, $cookie);
> curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
> curl_setopt($ch, CURLINFO_HEADER_OUT, true);
> curl_setopt($ch, CURLOPT_POST, 1 );
>
> curl_setopt($ch, CURLOPT_POSTFIELDS, $campos);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>
> $result = curl_exec($ch);
>
> Can anyone help?
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>
>
> __________ NOD32 3036 (20080418) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-06-24