Index: branches/2.2/filemanager/setup/phpgw_pt-br.lang
===================================================================
--- branches/2.2/filemanager/setup/phpgw_pt-br.lang	(revision 3885)
+++ branches/2.2/filemanager/setup/phpgw_pt-br.lang	(revision 3889)
@@ -47,4 +47,5 @@
 created by	filemanager	pt-br	Criado por
 Error:	filemanager	pt-br	Erro:
+ERROR: Use the advanced file sending!	filemanager	pt-br	ERRO: Utilize o envio avançado de arquivos!
 Are you sure you want to delete	filemanager	pt-br	Você tem certeza que deseja apagar
 Please type the text "%1" to delete	filemanager	pt-br	Por favor, tenha certeza e digite "%1" para apagar
Index: branches/2.2/filemanager/inc/upload.php
===================================================================
--- branches/2.2/filemanager/inc/upload.php	(revision 3881)
+++ branches/2.2/filemanager/inc/upload.php	(revision 3889)
@@ -2,4 +2,15 @@
 
 require_once '../../header.session.inc.php';
+
+$post_limit = error_get_last( );
+
+if ( preg_match( '/POST Content-Length of (\d+) bytes exceeds the limit of \d+ bytes/i', $post_limit[ 'message' ], $matches ) )
+{
+	$_SESSION['response'] =  serialize( array(
+		 'postsize' => $matches[ 1 ],
+		 'max_postsize' => ini_get( 'post_max_size' )
+	) );
+	exit;
+}
 
 /* This single file is used to increase upload_max_filesize and post_max_size using .htaccess*/
@@ -86,7 +97,16 @@
 if( $path != '/' )
 {
+	$return = array( );
 	for( $i = 0; $i != $show_upload_boxes; $i++)
 	{
-		if ( $_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024) )
+		if ( $_FILES['upload_file']['error'][$i] !== 0 )
+		{
+			$return[] = array( 
+					"file"		=> $_FILES['upload_file']['name'][$i] ,
+					"filesize"	=> 'filesize #' . $_FILES['upload_file']['error'][$i]
+			 );
+			continue;
+		}
+		elseif ( $_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024) )
 		{
 			$return[] = array( 
@@ -219,5 +239,5 @@
 	}
 	
-	error_log(print_r($return, true), 3, "/tmp/log");
+	//error_log(print_r($return, true), 3, "/tmp/log");
 }
 
Index: branches/2.2/filemanager/inc/uploadApp.php
===================================================================
--- branches/2.2/filemanager/inc/uploadApp.php	(revision 3610)
+++ branches/2.2/filemanager/inc/uploadApp.php	(revision 3889)
@@ -1,9 +1,12 @@
 <?php
-session_id($_GET['id']);
+
+session_id( $_GET['id'] );
 session_start();
-setcookie('jupload',$_GET['id'], time()+3600);
+setcookie( 'jupload', $_GET['id'], time()+3600 );
 
 include 'jupload.php';
-function handle_uploaded_files($juploadPhpSupportClass, $files) {
+
+function handle_uploaded_files($juploadPhpSupportClass, $files) 
+{
 	return
 		"<P>We are in the 'handle_uploaded_files' callback function, in the index.php script. To avoid double coding, we "
@@ -13,18 +16,30 @@
 
 }
+
+// Set Max File Size
+$maxFileSize = "10M";
+
+if ( file_exists('setFileMaxSize.php') )
+{
+	require_once('setFileMaxSize.php');
+	$maxFileSize  = unserialize(base64_decode($SET_FILE_MAX_SIZE));
+	$maxFileSize  = trim($maxFileSize)."M";
+}
+
 $appletParameters = array(
-    'maxFileSize' => '5G',
-    'maxChunkSize' => '1600000',
-	'archive' => '../tp/juploader/wjhk.jupload.jar',
-	'afterUploadURL' => 'after_upload.php',
-	'sendMD5Sum' => 'true',
-	'showLogWindow' => 'false',
-	'debugLevel' => 0 
-);
+							'maxFileSize' => $maxFileSize,
+							'maxChunkSize' => '1600000',
+							'archive' => '../tp/juploader/wjhk.jupload.jar',
+							'afterUploadURL' => 'after_upload.php',
+							'sendMD5Sum' => 'true',
+							'showLogWindow' => 'false',
+							'debugLevel' => 0 
+						);
+
 $classParameters = array(
-	'demo_mode' => false,
-	'allow_subdirs' => true,
-	'destdir' => '/tmp'  //Where to store the files on the webserver 
-);
+							'demo_mode' => false,
+							'allow_subdirs' => true,
+							'destdir' => '/tmp'  //Where to store the files on the webserver 
+						);
 
 $juploadPhpSupportClass = new JUpload($appletParameters, $classParameters);
@@ -33,4 +48,3 @@
 echo '<div align="left"><!--JUPLOAD_APPLET--></div>';
 
-
 ?>
Index: branches/2.2/filemanager/js/handler.js
===================================================================
--- branches/2.2/filemanager/js/handler.js	(revision 3882)
+++ branches/2.2/filemanager/js/handler.js	(revision 3889)
@@ -84,5 +84,5 @@
 		folders = unserialize(data);
 
-		var rootFold = new dNode({id:'root', caption: get_lang("Directories") });
+		var rootFold = new dNode({id:'root', caption: get_lang("Directories")});
 		folders_tree.add(rootFold,'root');
 
@@ -237,6 +237,19 @@
 		var response	= unserialize(data);
 
+		if ( response[ 'postsize' ] )
+		{
+			/*
+			 * 
+			 * response['postize'] = ERRO POST;
+			 * response['max_postsize] = diretiva do PHP para POST_MAX_SIZE;
+			 * 
+			 */ 
+			
+			write_msg( get_lang("ERROR: Use the advanced file sending!") );
+			return false;
+		}
+
 		if ( response[0] != "Ok" )
-		{	
+		{
 			for( var i = 0; i < response.length; i++ )
 			{
@@ -259,5 +272,5 @@
 							_div.style.background	= "url('"+path_filemanager+"images/warning.gif') no-repeat left top";
 							_div.style.cursor			= "pointer";
-							_div.onclick	= function(){ this.style.display = 'none'; } ;
+							_div.onclick	= function(){this.style.display = 'none';} ;
 							
 							if( response[i]['size_max'] )
@@ -281,4 +294,8 @@
 							{
 								_div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: "  + response[i]['undefined'];	
+							}
+							else if( response[i]['filesize'] )
+							{
+								_div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: "  + response[i]['filesize'];	
 							}
 						}
Index: branches/2.2/filemanager/templates/default/config.tpl
===================================================================
--- branches/2.2/filemanager/templates/default/config.tpl	(revision 3019)
+++ branches/2.2/filemanager/templates/default/config.tpl	(revision 3889)
@@ -1,43 +1,53 @@
 <!-- BEGIN header -->
+<script src='filemanager/inc/load_lang.php'></script>
+<script src='filemanager/js/connector.js'></script>
+<script src='filemanager/js/common_functions.js'></script>
+
 <form method="POST" action="{action_url}">
-<table border="0" align="center">
-   <tr bgcolor="{th_bg}">
-    <td colspan="2"><font color="{th_text}">&nbsp;<b>{title}</b></font></td>
-   </tr>
+	<table border="0" align="center">
+		<tr bgcolor="{th_bg}">
+			<td colspan="2">
+				<font color="{th_text}">&nbsp;<b>{title}</b></font>
+			</td>
+		</tr>
 <!-- END header -->
 <!-- BEGIN body -->
-    <tr bgcolor="{row_on}">
-    <td>{lang_Max_file_size}</td>
-    <td>
-    <input size="3" name="newsettings[filemanager_Max_file_size]" value="{value_filemanager_Max_file_size}">&nbsp;Mb
-    </td>
-    </tr>
-    <tr bgcolor="{row_off}">
-    <td>{lang_quota_size}</td>
-    <td>
-    <input size="3" name="newsettings[filemanager_quota_size]" value="{value_filemanager_quota_size}">&nbsp;Mb
-    </td>
-    </tr>
-    <tr bgcolor="{row_on}">
-    <td>{lang_antivirus_command}</td> 
-    <td>
-    <input size="40" name="newsettings[filemanager_antivirus_command]" value="{value_filemanager_antivirus_command}">
-    </td>
-    </tr>
+		<tr bgcolor="{row_on}">
+			<td>{lang_Max_file_size}</td>
+			<td>
+				<input size="3" name="newsettings[filemanager_Max_file_size]" value="{value_filemanager_Max_file_size}">&nbsp;Mb
+			</td>
+		</tr>
+		<tr bgcolor="{row_off}">
+			<td>{lang_quota_size}</td>
+			<td>
+				<input size="3" name="newsettings[filemanager_quota_size]" value="{value_filemanager_quota_size}">&nbsp;Mb
+			</td>
+		</tr>
+		<tr bgcolor="{row_on}">
+			<td>{lang_antivirus_command}</td> 
+			<td>
+				<input size="40" name="newsettings[filemanager_antivirus_command]" value="{value_filemanager_antivirus_command}">
+			</td>
+		</tr>
 
 <!-- END body -->
 <!-- BEGIN footer -->
-  <tr bgcolor="{th_bg}">
-    <td colspan="2">
-&nbsp;
-    </td>
-  </tr>
-  <tr>
-    <td colspan="2" align="center">
-      <input type="submit" name="submit" value="{lang_submit}">
-      <input type="submit" name="cancel" value="{lang_cancel}">
-    </td>
-  </tr>
-</table>
+		<tr bgcolor="{th_bg}">
+			<td colspan="2">&nbsp;</td>
+		</tr>
+		<tr>
+			<td colspan="2" align="center">
+				<input type="button" value="{lang_submit}" onclick="maxFileSize(document);">
+				<!--
+					No MSIE utilizar um botão do tipo submit não permite que seja gravado o arquivo e configuração.
+					Por esse motivo o envio do formulário está sendo feito através do javascript.
+					NÃO REMOVA...			 
+				-->
+				<input type="submit" name="submit" style="display: none">
+				<input type="submit" name="cancel" value="{lang_cancel}">
+			</td>
+		</tr>
+	</table>
 </form>
 <!-- END footer -->
