Results 1 to 10 of 10
-
20th Mar 2012, 03:33 PM #1OPMemberWebsite's:
satiq.netUpload to Share-online with cUrl
Hi,
I'm trying to upload to share-online with php and this is the simple code I use:
PHP Code:$linkSO = "http://".$SessionName21[1]."/upv3.php";
$postfieldsSO = array('username' => 'user', 'password' => 'pass', 'upload_session' => $SessionName21[0], 'chunk_no' => '1', 'chunk_number' => '1', 'filesize' => $sizeFileUPLOAD, 'fn' => '@'.$source_file, 'finalize' => '1');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $linkSO);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfieldsSO);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$postResultSO = curl_exec ($ch);
curl_close ($ch);
What I do wrong?
Thanksskinner Reviewed by skinner on . Upload to Share-online with cUrl Hi, I'm trying to upload to share-online with php and this is the simple code I use: $linkSO = "http://".$SessionName21."/upv3.php"; $postfieldsSO = array('username' => 'user', 'password' => 'pass', 'upload_session' => $SessionName21, 'chunk_no' => '1', 'chunk_number' => '1', 'filesize' => $sizeFileUPLOAD, 'fn' => '@'.$source_file, 'finalize' => '1'); $ch = curl_init(); Rating: 5
-
20th Mar 2012, 03:37 PM #2Member
dont know but did you not need the Api for that?!
http://www.share-online.biz/uploadapi/
maybe this help you?!
-
20th Mar 2012, 03:44 PM #3OPMemberWebsite's:
satiq.net
-
20th Mar 2012, 03:55 PM #4Respected MemberWebsite's:
DL4Everything.com Soft2050.inPHP Code:'@'.$source_file
-
20th Mar 2012, 04:30 PM #5OPMemberWebsite's:
satiq.net
-
20th Mar 2012, 04:30 PM #6MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comtry this
PHP Code:function shareonlinebiz_getsession($user,$pass){
$url = "http://www.share-online.biz/upv3_session.php";
$postdata = array();
$postdata['username'] = $user;
$postdata['password'] = $pass;
$strpage = curl_func($url,$postdata,'','',0);
return $strpage;
}
function shareonlinebizupload($filename,$filelocation,$username, $password){
$data = shareonlinebiz_getsession($username,$password);
$data = explode(';',$data);
$fpost = array();
$fpost["username"] = $username;
$fpost["password"] = $password;
$fpost["upload_session"] = $data[0];
$fpost['chunk_no'] = '1';
$fpost['chunk_number'] = '1';
$fpost['filesize'] = filesize($filelocation);
$fpost['fn'] = "@".$filelocation;
$fpost["finalize"] = "1";
//printr($fpost);
$server = 'http://'.$data[1];
//echo $server;
$page = curl_func($server,$fpost,'','',0);
echo $page;
$data = explode(';',$page);
$download_link=$data[0];
return $download_link;
}
-
20th Mar 2012, 05:46 PM #7OPMemberWebsite's:
satiq.net
-
20th Mar 2012, 05:49 PM #8MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comPHP Code: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; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
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);
}
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
$page = curl_exec($ch);
curl_close($ch);
if(empty($page)){
echo "<br/>Could not connect to host: <br/> $link <br/>";
//die();
}
else{
return $page;
}
}
-
20th Mar 2012, 05:51 PM #9OPMemberWebsite's:
satiq.netIt says:
Could not connect to host:
http://
EDIT: I've resolve making only one function from your two..
-
23rd Mar 2012, 01:52 AM #10MemberWebsite's:
tv-release.netThis for you - Tested By me and work good
PHP Code:<?php
/*
Upload to Share-online with cUrl
Fixed By: AdelSBM
*/
//----------------------------------
$user="0123456789"; // Username
$pass="HgHFGhFsfS"; // Password
$filelocation="999.rar"; // file Path
//-----------------------------------
shareonlinebizupload($filename,$filelocation,$user, $pass); // Let's upload
function shareonlinebiz_getsession($user,$pass){
$url = "http://www.share-online.biz/upv3_session.php";
$postdata = array();
$postdata['username'] = $user;
$postdata['password'] = $pass;
$strpage = curl_func($url,$postdata,'','',0);
return $strpage;
}
function shareonlinebizupload($filename,$filelocation,$user, $pass){
$data = shareonlinebiz_getsession($user,$pass);
$data = explode(';',$data);
$fpost = array();
$fpost["username"] = $user;
$fpost["password"] = $pass;
$fpost["upload_session"] = $data[0];
$fpost['chunk_no'] = '1';
$fpost['chunk_number'] = '1';
$fpost['filesize'] = filesize($filelocation);
$fpost['fn'] = "@".$filelocation;
$fpost["finalize"] = "1";
//printr($fpost);
$server = 'http://'.$data[1];
//echo $server;
$page = curl_func($server,$fpost,'','',0);
$data = explode(';',$page);
$download_link=$data[0];
echo $download_link;
}
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; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
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);
}
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
$page = curl_exec($ch);
curl_close($ch);
if(empty($page)){
echo "<br/>Could not connect to host: <br/> $link <br/>";
//die();
}
else{
return $page;
}
}
?>
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Need help] curl / php upload for mediafire?
By futureawesome in forum Web Development AreaReplies: 10Last Post: 13th Nov 2012, 12:50 PM -
Upload to Share-Online.biz with Perl Script
By Homosapien in forum Web Development AreaReplies: 2Last Post: 23rd Oct 2012, 04:31 PM -
Share-Online.biz Discussion Thread - Post your discussions related to Share-Online
By Jiung in forum File Host DiscussionReplies: 358Last Post: 9th Oct 2012, 11:46 PM -
share-online.biz upload script
By ciaociao4 in forum Web Development AreaReplies: 4Last Post: 3rd Apr 2012, 04:39 PM -
remote upload from easy-share/share.cx to
By algon in forum File Host DiscussionReplies: 3Last Post: 19th May 2011, 04:09 PM
themaPoster - post to forums and...
Version 5.23 released. Open older version (or...