aboutsummaryrefslogtreecommitdiffstats
path: root/.github/FILE_LINK.php
diff options
context:
space:
mode:
authorChristian Schneppe <kriztan@users.noreply.github.com>2017-03-27 12:56:19 +0200
committerGitHub <noreply@github.com>2017-03-27 12:56:19 +0200
commit967c36b5e21fda4caf9ec44ba74319e226adb064 (patch)
tree9d67d1331dcc86f6931eafdb000d51aa213a0892 /.github/FILE_LINK.php
parent286af7e2d68a9546203581c8227d4f5df8e7b22f (diff)
Update FILE_LINK.php
Diffstat (limited to '')
-rw-r--r--.github/FILE_LINK.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/.github/FILE_LINK.php b/.github/FILE_LINK.php
index 4d7ebb244..34fb4ad3b 100644
--- a/.github/FILE_LINK.php
+++ b/.github/FILE_LINK.php
@@ -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);
?>