Status
Not open for further replies.
SalmanAbbas007: CURLOPT_UPLOAD is to prepare for an upload using PUT, FTP or whatever curl supports, not just PUT. But yeah I see lulzimg doesn't support PUT, same as most, so nevermind. Although it still applies for FTP uploads to filehosts.
 
how how to use this script for upload from pc ? please help ...

Well if you want to use this from your pc, you have to have apache + php running on your pc (a local server) easiest way is LAMP for linux, WAMP for windows although its dated, or if you like XAMPP cross platform.

Once you have that up, just use the code in a php page and customize for your use.
 
Where is I`m wrong ?
Code:
<?php

    $site = "http://www.lulzimg.com/upload.php";
    $file = "image.jpg";

        $ch = curl_init($site);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS,
        array('image' => "@$file;type=image;type=image/jpeg"));
        
        $return = curl_exec($ch);
        curl_close($ch);
        
        echo $return;

?>
 
Status
Not open for further replies.
Back
Top