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
?>
Congratulations @filebot! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word
STOP
To support your work, I also upvoted your post!
Do not miss the last post from @steemitboard:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit