Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

cURL in PHP


ghost's Avatar
0 0

Since ImageShack sucks unless you buy some credits, I want to make a script that uploads images to ImageShack. Anyway, I am unable to upload an image! It always returns a '1' or the main pageā€¦ but nothing else. Here's what I've got so far:


$postData = array();

$postData['fileupload'] = "@dire1.jpg";
$postData['submit'] = "UPLOAD";
$postData['MAX_FILE_SIZE'] = '3145728';
      
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url );       
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_USERAGENT, $ua);


curl_setopt($ch, CURLOPT_POSTFIELDS, $postData );

$response = curl_exec( $ch );
echo $response;
?>```

Any ideas?

ghost's Avatar
0 0

Because, by default, Imageshack does not allow you to upload multiple images at a time.