Update FILE_LINK.php

This commit is contained in:
Christian Schneppe 2017-03-27 12:56:19 +02:00 committed by GitHub
parent 286af7e2d6
commit 967c36b5e2

View file

@ -1,5 +1,10 @@
<?php
$json = file_get_contents('https://api.github.com/repos/kriztan/Pix-Art-Messenger/releases/latest');
$data = json_decode($json);
echo $data->assets[0]->browser_download_url;
$filename = $data->assets[0]->name;
$filesize = $data->assets[0]->size;
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$filename.'";');
header('Content-Length: '.$filesize);
readfile($data->assets[0]->browser_download_url);
?>