From 0ca7583819336614af6248030b09099d020f2404 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 15 Dec 2008 14:55:04 -0800 Subject: [PATCH] human readable error when file too large --- ext/upload/main.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/upload/main.php b/ext/upload/main.php index 1de99bbd..25bf552a 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -92,7 +92,9 @@ class Upload extends 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)"); } } }