PHP CURL Problem with Pixhost.org

Status
Not open for further replies.

heppinnz

Active Member
94
2010
2
0
Hi people ! Please Help Me! When i try upload image with php + curl on this url
Code:
http://www.pixhost.org/cover-upload/
I`m everytime get one answer "Picture must be higher than 350px.".

Please help ME!
 
6 comments
as Apathetic said post your complete code here, what have you tried? what did not work? there is no detail except a post array. Help us to help you, give us the detail that matters about what's going on.
 
I am try upload image with this code:

PHP:
$curl = curl_init();
        curl_setopt_array($curl, array(
            CURLOPT_URL => 'http://www.pixhost.org/cover-upload/',
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_CONNECTTIMEOUT => 30,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => array(
                "0[]" => "@$file",
                'content_type' => '1',
                'tos' => 'on',
                'submit' => 'Upload'
        ));
        $return = curl_exec($curl);
        curl_close($curl);

But everytime get one answer "Picture must be higher than 350px.".


Thank you for help!
 
PHP:
// image file
$file = dirname(__FILE__)."/Chrysanthemum.jpg";
           $curl = curl_init();
            curl_setopt_array($curl, array(
            CURLOPT_URL => 'http://www.pixhost.org/cover-upload/',
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_REFERER => 'http://www.pixhost.org/cover-upload/',
            CURLOPT_CONNECTTIMEOUT => 30,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => array(
                '0"; filename="'.basename($file).'"' => "@".$file,
                'content_type' => '1',
                'tos' => 'on',
                'submit' => 'Upload'
        )));
        $return = curl_exec($curl);
        curl_close($curl);  
	echo  $return;

You have wrong post data, Dont just copy the code, compare with yours and learn from it...cheers
 
Last edited:
Status
Not open for further replies.
Back
Top