• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Site to site file copy script

Subhash

New Member
Can any on suggest me any script that can copy/upload file from another website by providing the url. That may be a free php script or some package.
 
Haven't done one of these posts for a while, hope no-one beats me to it .....

Pulled fresh from the --- of the php god ....

PHP:
<html>
<head>
<title>File Stealing</title>
</head>
<body>
<?
if(!function_exists("file_put_contents") )
{
  function file_put_contents( $file, $data )
  {
    $handle = fopen($file, "w+");
    if(!$handle) : return false; endif;
    if(!fwrite( $handle, $data, strlen($data))): return false; endif;
    fclose($handle);
    return true;
  }
}
if($_POST) :
 if( file_put_contents(basename($_POST['url']), file_get_contents($_POST['url']) ) ) 
 {
  echo "File stolen<br />";
 }
 else
 {
  echo "File NOT stolen<br />";
 }
endif;
?>
<form action="" method="post">
Enter URL of file to nick : <input type="text" name="url" /><br />
<input type="submit" value="Steal" />
</form>
</body>
</html>

Needs the folder that the file resides in to be chmod 0777 ..... someone might wanna make it prettier I dunno
 
Back
Top