--- index.php	2005-01-03 06:56:44.000000000 +0100
+++ index.php.new	2008-06-16 13:57:14.000000000 +0200
@@ -1490,6 +1490,28 @@
 {
 	for ($i = 0; $i != $show_upload_boxes; $i++)
 	{
+
+$uploadErrors = array(
+    UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive in php.ini.',
+    UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.',
+    UPLOAD_ERR_PARTIAL => 'The uploaded file was only partially uploaded.',
+    UPLOAD_ERR_NO_FILE => 'No file was uploaded.',
+    UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder.',
+    UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk.',
+    UPLOAD_ERR_EXTENSION => 'File upload stopped by extension.',
+);
+
+$errorCode = $_FILES['upload_file']['error'][$i];
+
+if($errorCode !== UPLOAD_ERR_OK)
+{
+    if(isset($uploadErrors[$errorCode]))
+	  echo $GLOBALS['phpgw']->common->error_list (array (lang($uploadErrors[$errorCode])));
+    else
+	  echo $GLOBALS['phpgw']->common->error_list (array (lang('Unknown error uploading file.')));
+  continue;
+}
+
 		if ($badchar = bad_chars ($_FILES['upload_file']['name'][$i], True, True))
 		{
 			echo $GLOBALS['phpgw']->common->error_list (array (html_encode (lang('File names cannot contain "%1"', $badchar), 1)));
