Results 1 to 4 of 4
-
21st Apr 2011, 04:02 PM #1OPMember
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
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=
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
-
21st Apr 2011, 06:33 PM #2OPMember
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($ch, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $formvars);
$res= curl_exec($ch);
curl_close ($ch);
-
21st Apr 2011, 06:39 PM #3Member
good work. but pls check ur pm
-
23rd Apr 2011, 10:23 PM #4Member
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.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Uploading to FileSonic Using cURL
By Gaurav in forum Web Development AreaReplies: 71Last Post: 14th Jan 2012, 03:00 AM -
Help with Uploading.com batch Link Checker and Curl ..
By Lock Down in forum Webmaster ResourcesReplies: 9Last Post: 3rd Dec 2010, 02:31 AM -
[linux] Uploading to FileServe via curl
By Snell in forum Tutorials and GuidesReplies: 0Last Post: 19th Jun 2010, 12:52 PM -
[guide] Uploading to Hofile using curl
By desiboy in forum Tutorials and GuidesReplies: 19Last Post: 30th May 2010, 07:40 PM
themaLeecher - leech and manage...
Version 4.94 released. Open older version (or...