mirror of
https://github.com/Chouchen/ShikiProxy.git
synced 2018-06-07 06:24:38 +02:00
Creation of the world
This commit is contained in:
31
shortcut.php
Normal file
31
shortcut.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
We need to find the matching file thanks to the todl.txt file
|
||||
Read it, send it then delete it from the txt file
|
||||
*/
|
||||
$idx = new ToDownloadIndex();
|
||||
|
||||
$shortcut = !empty($_GET['sc']) ? $_GET['sc'] : '';
|
||||
|
||||
if($shortcut == ''){
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
exit;
|
||||
}
|
||||
|
||||
$file = $idx->readLine($shortcut);
|
||||
|
||||
if($file == null || !is_readable(dirname(__FILE__).'/'.$file)){
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Content-type: application/zip");
|
||||
header("Content-Disposition: attachment; filename=".$file);
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
readfile(dirname(__FILE__).'/'.$file);
|
||||
unlink(dirname(__FILE__).'/'.$file);
|
||||
|
||||
$idx->deleteLine($shortcut);
|
||||
|
||||
exit;
|
Reference in New Issue
Block a user