Index: /branches/2.2/filemanager/tp/expressowindow/xsl/upload.xsl
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/xsl/upload.xsl	(revision 3879)
+++ /branches/2.2/filemanager/tp/expressowindow/xsl/upload.xsl	(revision 3881)
@@ -41,7 +41,7 @@
 						<div></div>
 					 	<input maxlength="255" name="upload_file[]" type="file" style="margin-right:5px" />
-						<input name="upload_comment[]" type="text"/>
-						<input type="hidden" name="uploadprocess" value="true"/>
-						<input type="hidden" name="path" value="{$path}"/>
+						<input name="upload_comment[]" type="text" />
+						<input type="hidden" name="uploadprocess" value="true" />
+						<input type="hidden" name="path" value="{$path}" />
 					</div>
 					
Index: /branches/2.2/filemanager/inc/upload.php
===================================================================
--- /branches/2.2/filemanager/inc/upload.php	(revision 3879)
+++ /branches/2.2/filemanager/inc/upload.php	(revision 3881)
@@ -23,7 +23,4 @@
 $show_upload_boxes	= count($_FILES['upload_file']['name']);
 $filesUpload				= $_FILES['upload_file'];
-
-
-error_log( print_r($_FILES['upload_file'], true), 3, "/tmp/log" );
 
 function create_summaryImage($file)
@@ -102,5 +99,7 @@
 		elseif( $_FILES['upload_file']['size'][$i] > 0 )
 		{
-			if( $badchar = $bo->bad_chars($_FILES['upload_file']['name'][$i], True, True ))
+			$badchar = $bo->bad_chars( $_FILES['upload_file']['name'][$i], True, True );
+			
+			if( $badchar )
 			{
 				$return[] = array(
@@ -219,4 +218,6 @@
 		}
 	}
+	
+	error_log(print_r($return, true), 3, "/tmp/log");
 }
 
Index: /branches/2.2/filemanager/js/handler.js
===================================================================
--- /branches/2.2/filemanager/js/handler.js	(revision 3880)
+++ /branches/2.2/filemanager/js/handler.js	(revision 3881)
@@ -232,24 +232,21 @@
 	function upload(data)
 	{
-		var response = unserialize(data);
-
-		if ( response[0] == "Ok" )
-		{
-			write_msg(get_lang('All files created sucessfuly'));
-			_winBuild( "dwindownewUpload" , "remove" );	
-		}
-		else
+		var _inputs		= document.getElementsByTagName('input');
+		var response	= unserialize(data);
+
+		if ( response[0] != "Ok" )
 		{	
-			var _inputs			= document.getElementsByTagName('input');
-			var removeInputs	= null;
-			
 			for( var i = 0; i < response.length; i++ )
 			{
 				for( var j = 0 ; j < _inputs.length ; j++ )
 				{
-					if( _inputs[j].getAttribute('type') == 'file' )
+					if( _inputs[j].getAttribute('type') == "file")
 					{	
-						if( _inputs[j].value.indexOf( response[i]['file'] ) > -1 )
-						{
+						var _indexOf = response[i]['file'].toUpperCase().indexOf(_inputs[j].value.toUpperCase() );
+						
+						if( response[i]['file'].toUpperCase() === _inputs[j].value.toUpperCase() && _indexOf > -1 )
+						{	
+							_inputs[j].setAttribute("erroUpload", "true");
+							
 							var _parent	= _inputs[j].parentNode;
 							var _div = _parent.firstChild;	
@@ -267,32 +264,37 @@
 											  + borkb( response[i]['size'] ) + "  - Permitido  " + borkb( response[i]['size_max'] );
 							}
-							else	if( response[i]['badchar'] )
+							else if( response[i]['badchar'] )
 							{	
 								_div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: "  + response[i]['badchar'];	
 							}
-							else	if( response[i]['directory'] )
+							else if( response[i]['directory'] )
 							{	
 								_div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: "  + response[i]['directory'];	
 							}
-							else	if( response[i]['sendFile'] )
+							else if( response[i]['sendFile'] )
 							{	
 								_div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: "  + response[i]['sendFile'];	
 							}
-							else	if( response[i]['undefined'] )
+							else if( response[i]['undefined'] )
 							{
 								_div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: "  + response[i]['undefined'];	
 							}
 						}
-						else
-							removeInputs = _inputs[j];
 					}
 				}	
-				
-				if( removeInputs != null )
-				{	
-					removeInputs.parentNode.parentNode.removeChild( removeInputs.parentNode );
-					removeInputs = null;
+			}
+			
+			for( var j = 0 ; j < _inputs.length ; j++ )
+			{	
+				if ( !_inputs[j].getAttribute("erroUpload") && _inputs[j].getAttribute('type') == "file" )
+				{
+					_inputs[j].parentNode.parentNode.removeChild( _inputs[j].parentNode );
 				}
-			}	
+			}
+		}
+		else
+		{
+			write_msg(get_lang('All files created sucessfuly'));
+			_winBuild( "dwindownewUpload" , "remove" );	
 		}	
 
