From: s-ko Date: Sat, 27 Sep 2014 19:43:22 +0000 (+0100) Subject: Added maximum upload size display X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3753951056d505cf82a3e8ff71495af88c6e1d2d;p=simple-upload.git Added maximum upload size display --- diff --git a/index.php b/index.php index 513d7d1..715b4ff 100644 --- a/index.php +++ b/index.php @@ -52,7 +52,7 @@ // Display debugging information - debug => false + debug => $_SERVER['SERVER_NAME'] === 'localhost' ); @@ -66,6 +66,12 @@ // URL to upload page $data['pageurl'] = "http" . (($_SERVER['SERVER_PORT']==443) ? "s://" : "://") . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . '/'; + // Use canonized path + $data['uploaddir'] = realpath($settings['uploaddir']); + + // Maximum upload size, set by system + $data['max_upload_size'] = ini_get('upload_max_filesize'); + if ($settings['debug']) { // Enabling error reporting error_reporting(E_ALL); @@ -107,7 +113,7 @@ if ($settings['random_name_keep_type']) $data['target_file_name'] .= '.' . pathinfo($data['uploaded_file_name'], PATHINFO_EXTENSION); } - $data['upload_target_file'] = $settings['uploaddir'] . DIRECTORY_SEPARATOR . $data['target_file_name']; + $data['upload_target_file'] = $data['uploaddir'] . DIRECTORY_SEPARATOR . $data['target_file_name']; $data['tmp_name'] = $_FILES['file']['tmp_name']; if ($settings['debug']) { @@ -305,6 +311,10 @@ +

Simple PHP Upload

+

+ Maximum upload size: +

Choose File: