diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index 26f6bcd45538121b37a29514e753617257320ba2..e206f2fc95333b66f95997cd43909e7e2a6537bf 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -113,6 +113,7 @@ $lang['uploadexist'] = 'File already exists. Nothing done.'; $lang['uploadbadcontent'] = 'The uploaded content did not match the %s file extension.'; $lang['uploadspam'] = 'The upload was blocked by the spam blacklist.'; $lang['uploadxss'] = 'The upload was blocked for possibly malicious content.'; +$lang['uploadsize'] = 'The uploaded file was too big. (max. %s)'; $lang['deletesucc'] = 'The file "%s" has been deleted.'; $lang['deletefail'] = '"%s" couldn\'t be deleted - check permissions.'; $lang['mediainuse'] = 'The file "%s" hasn\'t been deleted - it is still in use.'; diff --git a/lib/exe/mediamanager.php b/lib/exe/mediamanager.php index a83d5d772b78f842b1f7fc3922e328c2998f1a2c..97afae9b76a8ee6f8a8b66727c94fa909cd527f4 100644 --- a/lib/exe/mediamanager.php +++ b/lib/exe/mediamanager.php @@ -53,6 +53,16 @@ exit; } + // give info on PHP catched upload errors + if($_FILES['upload']['error']) switch($_FILES['upload']['error']){ + case 1: + case 2: + msg(sprintf($lang['uploadsize'], + filesize_h(php_to_byte(ini_get('upload_max_filesize')))),-1); + break; + default: + msg($lang['uploadfail'],-1); + } // handle upload if($_FILES['upload']['tmp_name']){