0.7.10.3
This commit is contained in:
27
web/handle_zip.php
Normal file
27
web/handle_zip.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?
|
||||
|
||||
$types['txt'] = "text/plain";
|
||||
$types['log'] = "text/plain";
|
||||
$types['csv'] = "text/plain";
|
||||
$types['webloc'] = "application/xml";
|
||||
$types['svg'] = "image/svg+xml";
|
||||
//$types['rtf'] = "application/rtf";
|
||||
$types['rtfd'] = "application/rtf";
|
||||
$types['doc'] = "application/msword";
|
||||
$types['docx'] = "application/msword";
|
||||
|
||||
require "togggle.php";
|
||||
|
||||
$zip = new ZipArchive;
|
||||
$zip->open($_GET['file']);
|
||||
$stat = $zip->statIndex(0);
|
||||
|
||||
if (!$mime = $types[pathinfo($stat['name'],PATHINFO_EXTENSION)]) {
|
||||
$mime = "text/plain";
|
||||
}
|
||||
|
||||
header("Content-Type: ".$mime);
|
||||
header("Content-Length: ".$stat['size']);
|
||||
echo $zip->getFromIndex(0);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user