From 529fc0c2030c8e2cd61c3482649122e3139843b4 Mon Sep 17 00:00:00 2001 From: e107steved Date: Tue, 17 Jul 2007 19:53:33 +0000 Subject: [PATCH] Adjust error checking on multiple file upload --- e107_plugins/forum/forum_post.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 5d4d05c76..26a899bdd 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $ -| $Revision: 1.8 $ -| $Date: 2007-06-26 21:34:34 $ +| $Revision: 1.9 $ +| $Date: 2007-07-17 19:53:33 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -593,13 +593,15 @@ function process_upload() $tid = 0; } - if (isset($_FILES['file_userfile']['error']) && $_FILES['file_userfile']['error'] != 4) + if (isset($_FILES['file_userfile']['error'])) { require_once(e_HANDLER."upload_handler.php"); if ($uploaded = file_upload('/'.e_FILE."public/", "attachment", "FT{$tid}_")) { foreach($uploaded as $upload) { + if ($upload['error'] == 0) + { if(strstr($upload['type'], "image")) { if(isset($pref['forum_maxwidth']) && $pref['forum_maxwidth'] > 0) @@ -645,9 +647,18 @@ function process_upload() //echo "
"; print_r($upload); echo "
"; $_POST['post'] .= "[br][file=".e_FILE."public/".$upload['name']."]".(isset($upload['rawname']) ? $upload['rawname'] : $upload['name'])."[/file]"; } - + } + else + { // Error in uploaded file + echo "Error in uploaded file: ".(isset($upload['rawname']) ? $upload['rawname'] : $upload['name'])."
"; + } } } + else + { + // Error in uploaded files + echo "Problem with uploading files
"; + } } }