Results 1 to 5 of 5
-
21st Jun 2012, 06:48 PM #1OPMember
[Help] PHP Curl Lumfile.com Problem
Hi people! I Try upload files to this hosting, and get download link, but file does not appear in my files in my account.
this is my code:
PHP Code:function lumfile($user, $pass, $file) {
$login = curl_init();
curl_setopt_array($login, array(
CURLOPT_URL => 'http://lumfile.com/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_COOKIEJAR => 'lumfile.cookie',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => "op=login&redirect=http%3A%2F%2Flumfile.com%2F&login=$user&password=$pass"
));
curl_exec($login);
curl_close($login);
$server = curl_init();
curl_setopt_array($server, array(
CURLOPT_URL => 'http://lumfile.com/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_COOKIEFILE => 'lumfile.cookie'
));
$result = curl_exec($server);
curl_close($server);
preg_match('/action="(.*?)"/i', $result, $match);
preg_match_all('/value="(.*?)"/i', $result, $out);
$srv = $match[1];
$id = $out[1][3];
$tmp = $out[1][4];
$uid = '';
$i = 0;
while($i < 12) {
$uid .= rand(0,9);
$i++;
}
$up_url = $srv . $uid . '&js_on=1&utype=reg&upload_type=file';
$url = $up_url;
$upload = curl_init();
curl_setopt_array($upload, array(
CURLOPT_URL => $url,
CURLOPT_REFERER => 'http://lumfile.com/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_COOKIEFILE => 'lumfile.cookie',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array(
'upload_type' => 'file',
'sess_id' => $id,
'srv_tmp_url' => $tmp,
'link_rcpt' => '',
'link_pass' => '',
'file_0' => "@$file",
'tos' => '1',
'submit_btn' => 'Upload! '
)
));
$result = curl_exec($upload);
curl_close($upload);
preg_match("/name='fn'>(.*?)</i", $result, $dl);
$fn = $dl[1];
$getlink = curl_init();
curl_setopt_array($getlink, array(
CURLOPT_URL => 'http://lumfile.com/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_COOKIEFILE => 'lumfile.cookie',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => "fn=$fn&st=OK&op=upload_result"
));
$res = curl_exec($getlink);
curl_close($getlink);
preg_match('@(https?://(?:www\.)?lumfile\.com/\w+(?:/[^\?|/|<|>|\"|\'|\r|\n]+)?(?:\.html)?)\?killcode=\w+@i', $res, $match);
return $match[1];
}
heppinnz Reviewed by heppinnz on . [Help] PHP Curl Lumfile.com Problem Hi people! I Try upload files to this hosting, and get download link, but file does not appear in my files in my account. this is my code: function lumfile($user, $pass, $file) { $login = curl_init(); curl_setopt_array($login, array( CURLOPT_URL => 'http://lumfile.com/', CURLOPT_RETURNTRANSFER => true, Rating: 5
-
23rd Jun 2012, 12:33 PM #2MemberWebsite's:
sborg.usI guess it's the issue from the filehost's end.
Tried uploading a small file (around thrice) and I wasn't redirected to the download link page at all!
V3g3ta | Halcyon | Abhi
-
23rd Jun 2012, 12:57 PM #3OPMemberI guess it's the issue from the filehost's end.
Tried uploading a small file (around thrice) and I wasn't redirected to the download link page at all!
Very strange, a link to download the file I get, but the files in my account is not
-
23rd Jun 2012, 01:56 PM #4MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comTry this
PHP Code:<?
$debug = true;
$img = dirname(__FILE__).'/0001.jpg';
$link = upload_lumfile('0001.jpg', $img, 'user', 'pass');
echo '<br /><br /><b>Download link: </b>'.$link;
function upload_lumfile($filename, $file, $username, $password) {
global $debug;
$cookie = dirname(__FILE__).'/upload_hosts_lumfile.txt';
lumfile_login($username,$password,$cookie);
$d = lumfileupload($filename,$file,$cookie,$username, $password);
if(preg_match('~http://lumfile\.com/(.*?)$~i',$d)) return $d;
else return '';
}
function lumfile_login($user,$pass,$cookie){
global $debug;
$ref = "http://lumfile.com/login.html";
$url = "http://lumfile.com/";
$post = array();
$post['op'] = 'login';
$post['redirect'] = 'http://lumfile.com/';
$post['login'] = $user;
$post['password'] = $pass;
$strpage = curl_func($url,$post,$cookie,$ref);
if($debug) echo '<br /><textarea>'.htmlentities($strpage).'</textarea>';echo '<br />';
}
function lumfileupload($filename,$filelocation,$cookie,$username, $password){
global $debug;
$download_link = '';
$ref = "http://lumfile.com/";
$url = 'http://lumfile.com/';
$page = curl_func($url,'',$cookie,$ref);
if($debug) echo '<br /><textarea>'.htmlentities($page).'</textarea>';
$post = array();
$post["upload_type"] = 'file';
$post["sess_id"] = cut_str($page, 'name="sess_id" value="','"');
$post["srv_tmp_url"] = cut_str($page, 'name="srv_tmp_url" value="','"');
$post['file_0; filename="'.$filename.'"'] = "@".$filelocation;
$server = cut_str($page, '<form name="file" enctype="multipart/form-data" action="','"');
if($debug) echo '<br />'.$server;
if($debug) { echo '<br />'; print_r($post); }
$page = curl_func($server,$post,$cookie,$ref);
if($debug) echo '<br /><textarea>'.htmlentities($page).'</textarea>';
if(preg_match('~<textarea id="ic0-\d+" style="width:98%;" rows=3 onFocus="copy\(this\);">http://lumfile.com/(.*?)</textarea>~ism',$page,$matches)) {
if($debug) { echo '<br />'; print_r($matches);echo '<br />'; }
$download_link = 'http://lumfile.com/'.$matches[1];
return $download_link;
}
else return false;
}
function cut_str($a,$b,$c){$a=substr(stristr($a,$b),strlen($b));$d=strlen(stristr($a,$c));$d=$d ? - ($d) : strlen($a);$a=substr($a,0,$d);return $a;}
function curl_func($link, $postfields = '', $cookie = '', $refer = '', $header = 1, $follow = 1, $usragent = ''){
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($header)
curl_setopt($ch, CURLOPT_HEADER, 1);
else
curl_setopt($ch, CURLOPT_HEADER, 0);
if($follow)
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
else
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
if($usragent)
curl_setopt($ch, CURLOPT_USERAGENT, $usragent);
else
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0');
if($refer)
curl_setopt($ch, CURLOPT_REFERER, $refer);
if($postfields){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
}
if($cookie){
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
}
$page = curl_exec($ch);
curl_close($ch);
return $page;
}
?>
-
23rd Jun 2012, 02:21 PM #5OPMember
t3od0r: Thank you very much!
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Lumfile Discussion Thread - Post your discussions related to Lumfile here.
By pcx2012 in forum File Host DiscussionReplies: 3Last Post: 30th Oct 2012, 05:53 AM -
lumfile.com Discussion Thread - Post your discussions related to Lumfile here.
By patchrapa in forum File Host DiscussionReplies: 3Last Post: 4th Jul 2012, 08:28 AM -
Lumfile Discussion Thread - Post your discussions related to Lumfile
By Mr.leg in forum File Host DiscussionReplies: 656Last Post: 24th Jun 2012, 03:03 AM -
cURL or PHP Problem.
By deelow66 in forum Technical and Security TutorialsReplies: 4Last Post: 2nd May 2010, 01:57 AM
themaCreator - create posts from...
Version 3.22 released. Open older version (or...