Activity Stream
48,167 MEMBERS
61122 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 4 of 4
  1.     
    #1
    Member

    Default Uploading images to imageporter with curl

    Hello,
    I'm trying to use curl to upload images to imageporter. So far, uploading is working, but it's not uploaded to my account, which is really strange as I'm using cookies.

    Code: 
    curl --cookie-jar cookies.txt --data "op=login&redirect=&login=***&password=***&x=0&y=0" http://www.imageporter.com
    That's for the cookie

    Code: 
     curl -L -b ./cookies.txt -F "my_file_element=@/path/to/some.jpg" -F "adult=adult" -F "thumb_size=170x170" -F "tos=on" http://img52.imageporter.com/cgi-bin/upload.cgi?upload_id=
    That's for the upload

    Any idea on what's wrong with this command?
    hover Reviewed by hover on . [help] Uploading images to imageporter with curl Hello, I'm trying to use curl to upload images to imageporter. So far, uploading is working, but it's not uploaded to my account, which is really strange as I'm using cookies. curl --cookie-jar cookies.txt --data "op=login&redirect=&login=***&password=***&x=0&y=0" http://www.imageporter.com That's for the cookie curl -L -b ./cookies.txt -F "my_file_element=@/path/to/some.jpg" -F "adult=adult" -F "thumb_size=170x170" -F "tos=on" Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Figured it out, for those ineterested your php code looks like this:

    PHP Code: 
    $submit_url "http://img52.imageporter.com/cgi-bin/upload.cgi?upload_id="
    $cook file_get_contents('cookies.txt');
    preg_match('/xfss.*/'$cook$match);
    $sessionID trim(str_replace('xfss'''$match[0]));
    $formvars ['sess_id'] = $sessionID;
    $formvars ['rv_tmp_url'] = "http://img52.imageporter.com/tmp";
    $formvars ['my_file_element='] = "@/path/to/some.jpg";
    $formvars ['thumb_size'] = "190x190";
    $formvars ['adult'] = "adult";
    $formvars ['tos'] = "1";

    $ch curl_init($submit_url); 
    curl_setopt($chCURLOPT_COOKIEFILE"cookies.txt");
    curl_setopt($chCURLOPT_FOLLOWLOCATION,1);
    curl_setopt($chCURLOPT_RETURNTRANSFER1); 
    curl_setopt($chCURLOPT_POSTFIELDS$formvars); 
    $rescurl_exec($ch); 
    curl_close ($ch); 

  4.     
    #3
    Member
    good work. but pls check ur pm

  5.     
    #4
    Member
    Looks nice, may I ask what you're using this for?

    I've done something similar with imagebam (most forums approve of it), but haven't tried using cookies to upload. They have an api with oauth for that which is a pain lol.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Uploading to FileSonic Using cURL
    By Gaurav in forum Web Development Area
    Replies: 71
    Last Post: 14th Jan 2012, 03:00 AM
  2. Help with Uploading.com batch Link Checker and Curl ..
    By Lock Down in forum Webmaster Resources
    Replies: 9
    Last Post: 3rd Dec 2010, 02:31 AM
  3. [linux] Uploading to FileServe via curl
    By Snell in forum Tutorials and Guides
    Replies: 0
    Last Post: 19th Jun 2010, 12:52 PM
  4. [guide] Uploading to Hofile using curl
    By desiboy in forum Tutorials and Guides
    Replies: 19
    Last Post: 30th May 2010, 07:40 PM

Tags for this Thread

BE SOCIAL