human readable error when file too large

This commit is contained in:
Shish 2008-12-15 14:55:04 -08:00
parent f735936a7d
commit fd9443cf84

View File

@ -92,7 +92,9 @@ class Upload implements Extension {
$event->veto("Upload failed; disk nearly full");
}
if(filesize($event->tmpname) > $config->get_int('upload_size')) {
$event->veto("File too large (".filesize($event->tmpname)." > ".($config->get_int('upload_size')).")");
$size = to_shorthand_int(filesize($event->tmpname));
$limit = to_shorthand_int($config->get_int('upload_size'));
$event->veto("File too large ($size > $limit)");
}
}
}