Curl Upload zu ImageShack
Hallo,
ich möchte ein Bild mit Curl und PHP eine Grafik hochladen
Nun stoße ich dabei immer auf ein Problem. Ich erhalte immer ein 411 Fehler "Lenght Required".
Das problem dabei ist das CURL das ja automatisch generieren sollte. Selbst wenn ich den per hand einfüge beim HTTPHEADER wirft er immer noch eine 411 raus.
Was mache ich falsch?
Was mache ich falsch?
Das problem dabei ist das CURL das ja automatisch generieren sollte. Selbst wenn ich den per hand einfüge beim HTTPHEADER wirft er immer noch eine 411 raus.
Was mache ich falsch?
$form = array(
'key' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
'fileupload' => '@'.$this->file,
'xml' => 'yes',
);
curl_setopt($this->ch, CURLOPT_URL, 'http://www.imageshack.us/upload_api.php');
curl_setopt($this->ch, CURLOPT_HEADER, false);
curl_setopt($this->ch, CURLOPT_POST, true);
curl_setopt($this->ch, CURLOPT_UPLOAD, true);
curl_setopt($this->ch, CURLOPT_VERBOSE, true);
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $form);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
//curl_setopt($this->ch, CURLOPT_INFILE, fopen($this->file, 'r'));
//curl_setopt($this->ch, CURLOPT_INFILESIZE, $this->filesize);
curl_setopt($this->ch, CURLOPT_TIMEOUT, 240);
curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Expect: '));
Was mache ich falsch?
Please also mark the comments that contributed to the solution of the article
Content-Key: 163147
Url: https://administrator.de/contentid/163147
Printed on: April 25, 2024 at 04:04 o'clock