mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-10 10:36:47 +01:00
classes expanded
This commit is contained in:
@@ -1,26 +1,17 @@
|
||||
<?php
|
||||
include "headers.php";
|
||||
include "settings.php";
|
||||
require "icecoder.php";
|
||||
|
||||
use ICEcoder\File;
|
||||
|
||||
// Establish the real absolute path to the file
|
||||
$file = realpath($docRoot . $iceRoot . str_replace("|", "/", $_GET['file']));
|
||||
$filePath = realpath($docRoot . $iceRoot . str_replace("|", "/", $_GET['file']));
|
||||
// If it doesn't exist, or doesn't start with the $docRoot, stop here
|
||||
if (false === file_exists($file) || 0 !== strpos(str_replace("\\", "/", $file), $docRoot)) {
|
||||
if (false === file_exists($filePath) || 0 !== strpos(str_replace("\\", "/", $filePath), $docRoot)) {
|
||||
die("<script>ICEcoder.message('Sorry, that file doesn\'t appear to exist');</script>");
|
||||
}
|
||||
|
||||
if (true === file_exists($file)) {
|
||||
header("Pragma: public");
|
||||
header("Expires: 0");
|
||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||
header("Cache-Control: public");
|
||||
header('Content-Description: File Transfer');
|
||||
header("Content-Type: application/octet-stream");
|
||||
header('Content-Disposition: attachment; filename=' . basename($file));
|
||||
// header("Content-Transfer-Encoding: binary");
|
||||
header('Content-Length: ' . filesize($file));
|
||||
ob_clean();
|
||||
flush();
|
||||
readfile($file);
|
||||
if (true === file_exists($filePath)) {
|
||||
$file = new File();
|
||||
$file->download($filePath);
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<?php
|
||||
// Classes
|
||||
require_once "../classes/_ExtraProcesses.php";
|
||||
require_once "../classes/Backup.php";
|
||||
require_once "../classes/File.php";
|
||||
require_once "../classes/FTP.php";
|
||||
require_once "../classes/System.php";
|
||||
require_once "../classes/URL.php";
|
||||
|
||||
// Headers & Settings
|
||||
require_once "headers.php";
|
||||
|
||||
Reference in New Issue
Block a user