Skip to content
WJunction - Webmaster Forum

[REQ]lulzimg upload with php

Status
Not open for further replies.

26 comments

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.

About the author

J
Established Member · Joined
php/linux guru :p php, web, linux, python
415
Messages
45
Reactions
28
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom