diff options
Diffstat (limited to 'download.php')
| -rw-r--r-- | download.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/download.php b/download.php new file mode 100644 index 0000000..c40ee2d --- /dev/null +++ b/download.php | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | <?php | ||
| 2 | $file_names = ['win' => 'rustdesk.bat', 'deb' => 'rustdesk.sh', 'arch' => 'rustdesk.sh']; | ||
| 3 | $scripts = ['win' => 'scripts/rustdesk.bat', 'deb' => 'scripts/rustdesk-deb.sh', 'arch' => 'scripts/rustdesk-arch.sh']; | ||
| 4 | |||
| 5 | header("Content-Type: application/octet-stream"); | ||
| 6 | header('Content-Disposition: attachment; filename="' . $file_names[$_GET['os']] . '"'); | ||
| 7 | header('Content-Length: ' . filesize($scripts[$_GET['os']])); | ||
| 8 | |||
| 9 | readfile($scripts[$_GET['os']]); | ||
| 10 | exit; \ No newline at end of file | ||
