Skip to content
WJunction - Webmaster Forum

[req] php curl filepost.com uploader

Status
Not open for further replies.

23 comments

is it still working? please confirm me.
feeling lazy SplitIce?
here you go, just wrote now for you guys
PHP:
<?php
/**
 * written by mRAza
 * 11-09-2011
 *
 *
 * Usage: 	$link = upFilepost($user,$password,$cookie,$file);
 **/
function upFilepost($user,$password,$cookie,$file){
		$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4)Gecko/20030624 Netscape/7.1 (ax)";
		
		$post = 'email='.$user.'&password='.$password;
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, "http://filepost.com/general/login_form/");
		curl_setopt($ch, CURLOPT_USERAGENT, $agent);
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
        curl_setopt($ch, CURLOPT_HEADER, 1);
		curl_setopt($ch, CURLOPT_REFERER, "http://filepost.com/");
		curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
		curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
		$result = curl_exec($ch);
		
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, "http://filepost.com/files/upload/");
		curl_setopt($ch, CURLOPT_USERAGENT, $agent);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
        curl_setopt($ch, CURLOPT_HEADER, 1);
		curl_setopt($ch, CURLOPT_REFERER, "http://filepost.com/");
		curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
		curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
		$result = curl_exec($ch);

		preg_match("#upload_url: '(.*)'#",$result,$upURL);
		$upURL =  $upURL[1];
		preg_match("#SID: '(.*)'#",$result,$SID);
		$SID = $SID[1];
      		

        $post = array();
        $post['file']="@$file";
        $post['SID']=$SID;
        $post['Filename']= basename($file);
        $post['Upload']="Submit Query";

		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $upURL);
		curl_setopt($ch, CURLOPT_USERAGENT, 'Shockwave Flash');
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
        curl_setopt($ch, CURLOPT_HEADER, 1);
		curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
		curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
		$result = curl_exec($ch);

		preg_match("#answer\":\"(.*)\"#",$result,$answer);
		$answer = $answer[1];
        if ($answer ){
		
			$url = 'http://filepost.com/files/done/'.$answer.'/?JsHttpRequest';

			$ch = curl_init();
			curl_setopt($ch, CURLOPT_URL, $url);
			curl_setopt($ch, CURLOPT_USERAGENT, $agent);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
			curl_setopt($ch, CURLOPT_HEADER, 1);
			curl_setopt($ch, CURLOPT_REFERER, "http://filepost.com/");
			curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
			curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
			$result = curl_exec($ch);
			curl_close($ch);

			preg_match("#id=\"down_link\" class=\"inp_text\" value=\"(.*)\"#",$result,$link);
			if($link) {
				return $link[1];

        }

        }
		
		return false;
		
}		


?>
 
i am getting this error massage in my cookie file:

Code:
.filepost.com	TRUE	/	FALSE	1326046006	error	Method%20%22submit%22%20not%20found%20in%20class%20%22Module_files__done%22%20in%20module%20%22files%3Adone%22%21
 
Status
Not open for further replies.

About the author

H
Active Member · Joined
94
Messages
2
Reactions
8
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom