This post is from a low-reputation account and contains an unverified outbound link. Be cautious before clicking external links.

base64download

filebot(29)
Published in
#base64
Words
10
Reading
1 min
Listen
Play
8y

base64download.php to access the files from any server running php.

<?php require_once 'cleanstring.php'; $user = $_GET['user']; $permlink = $_GET['permlink']; $jsid = rand(1,90); $content = "{ \"id\":\"$jsid\", \"jsonrpc\":\"2.0\", \"method\":\"get_content\", \"params\":[\"$user\",\"$permlink\"] }";

$url = "http://steemd.privex.io/";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER,
array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);

$json_response = curl_exec($curl);

$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

if ( $status != 200 ) {
$url = "https://api.steemit.com/";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER,
array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);

$json_response = curl_exec($curl);

$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

if ( $status != 200 )
{
    die("No Steem Api response, please try again.");
}

}

curl_close($curl);

$response = json_decode($json_response, true);

$compbody = $response['result']['body'];

$teile = explode("base64filename", $compbody);

$filename = $teile['1'];
$filebodyprep = $teile['2'];
$teile = explode("base64file",$filebodyprep);
$filebody = $teile['1'];
$filebody = base64_decode($filebody);
$filename = removespace($filename);

$tempdir = sys_get_temp_dir();
$tmpName = "$tempdir/$filename";

$file = fopen($tmpName, 'w');

fwrite($file, $filebody);
fclose($file);

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($tmpName).'"');
header('Pragma: public');
header('Content-Length: ' . filesize($tmpName));
readfile($tmpName);

ob_clean();
flush();
unlink($tmpName);
//decode test end

?>

base64download | Ecency