Aug 16th, 2012, 9:57 AM
(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>