summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/lang/en/lang.php1
-rw-r--r--lib/exe/mediamanager.php10
2 files changed, 11 insertions, 0 deletions
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 26f6bcd45..e206f2fc9 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 a83d5d772..97afae9b7 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']){