From 658a9288f1436fdea1d6199718842657efc7bde1 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Wed, 29 Jan 2014 11:41:22 +0100 Subject: [PATCH] read allowed max-file-size from php.ini in webftp script, fixes #1370 Signed-off-by: Michael Kaufmann (d00p) --- webftp.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webftp.php b/webftp.php index 0596fb9d..a6f837cd 100644 --- a/webftp.php +++ b/webftp.php @@ -37,8 +37,13 @@ $editFileExtensions = array("php[345]?$","sh$","txt$","[ps]?htm[l]?$","tpl$","pl $editFileNoExtension = true; // Which FTP - mode should be used by default? $default_mode = "FTP_BINARY"; -// Max. uploadsize (0 = unlimited) -$MAX_FILE_SIZE = 1907300; +// Max. uploadsize (0 = unlimited) - read from php.ini +$_mfs = ini_get('upload_max_filesize'); +if ($_mfs === false || is_numeric(_mfs) == false) { + $MAX_FILE_SIZE = 1907300; +} else { + $MAX_FILE_SIZE = $_mfs; +} // The color of a marked row $marked_color = '#FFC2CA';