The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Show error if file upload exceeds limit - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: Feature Suggestions (https://forums.formtools.org/forumdisplay.php?fid=7)
+--- Thread: Show error if file upload exceeds limit (/showthread.php?tid=1995)



Show error if file upload exceeds limit - JediCharles - Apr 20th, 2012

When files being uploaded exceed the limit there needs to be an error message stating that the file is too large. Currently if the file is too large a 500 Internal Server Error is displayed and the message get's sent with no files.


RE: Show error if file upload exceeds limit - bills - Aug 16th, 2012

(Apr 20th, 2012, 2:29 PM)JediCharles Wrote: When files being uploaded exceed the limit there needs to be an error message stating that the file is too large. Currently if the file is too large a 500 Internal Server Error is displayed and the message get's sent with no files.

I solved that issue using javascript placed at the beginning of the process.php file located in the formtools installation folder.

$max_filesize = 524288;
// Maximum filesize in BYTES (currently 0.5MB).

$upload_path = '../formtools/upload/'; // change to your upload path

$filename = $_FILES['userfile']['name'];
// Get the name of the file (including file extension).

$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1);
// Get the extension from the filename.

// Now check the filesize, if it is too large then DIE and inform the user.
if(filesize($_FILES['userfile']['name']) > $max_filesize)
die('The file you attempted to upload is too large.');

Then add to 'die'.
<a href="#" onclick="history.go(-1);return false;">BACK</a>