Changeset 3889
- Timestamp:
- 03/22/11 18:19:49 (12 years ago)
- Location:
- branches/2.2/filemanager
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/filemanager/inc/upload.php
r3881 r3889 2 2 3 3 require_once '../../header.session.inc.php'; 4 5 $post_limit = error_get_last( ); 6 7 if ( preg_match( '/POST Content-Length of (\d+) bytes exceeds the limit of \d+ bytes/i', $post_limit[ 'message' ], $matches ) ) 8 { 9 $_SESSION['response'] = serialize( array( 10 'postsize' => $matches[ 1 ], 11 'max_postsize' => ini_get( 'post_max_size' ) 12 ) ); 13 exit; 14 } 4 15 5 16 /* This single file is used to increase upload_max_filesize and post_max_size using .htaccess*/ … … 86 97 if( $path != '/' ) 87 98 { 99 $return = array( ); 88 100 for( $i = 0; $i != $show_upload_boxes; $i++) 89 101 { 90 if ( $_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024) ) 102 if ( $_FILES['upload_file']['error'][$i] !== 0 ) 103 { 104 $return[] = array( 105 "file" => $_FILES['upload_file']['name'][$i] , 106 "filesize" => 'filesize #' . $_FILES['upload_file']['error'][$i] 107 ); 108 continue; 109 } 110 elseif ( $_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024) ) 91 111 { 92 112 $return[] = array( … … 219 239 } 220 240 221 error_log(print_r($return, true), 3, "/tmp/log");241 //error_log(print_r($return, true), 3, "/tmp/log"); 222 242 } 223 243 -
branches/2.2/filemanager/inc/uploadApp.php
r3610 r3889 1 1 <?php 2 session_id($_GET['id']); 2 3 session_id( $_GET['id'] ); 3 4 session_start(); 4 setcookie( 'jupload',$_GET['id'], time()+3600);5 setcookie( 'jupload', $_GET['id'], time()+3600 ); 5 6 6 7 include 'jupload.php'; 7 function handle_uploaded_files($juploadPhpSupportClass, $files) { 8 9 function handle_uploaded_files($juploadPhpSupportClass, $files) 10 { 8 11 return 9 12 "<P>We are in the 'handle_uploaded_files' callback function, in the index.php script. To avoid double coding, we " … … 13 16 14 17 } 18 19 // Set Max File Size 20 $maxFileSize = "10M"; 21 22 if ( file_exists('setFileMaxSize.php') ) 23 { 24 require_once('setFileMaxSize.php'); 25 $maxFileSize = unserialize(base64_decode($SET_FILE_MAX_SIZE)); 26 $maxFileSize = trim($maxFileSize)."M"; 27 } 28 15 29 $appletParameters = array( 16 'maxFileSize' => '5G', 17 'maxChunkSize' => '1600000', 18 'archive' => '../tp/juploader/wjhk.jupload.jar', 19 'afterUploadURL' => 'after_upload.php', 20 'sendMD5Sum' => 'true', 21 'showLogWindow' => 'false', 22 'debugLevel' => 0 23 ); 30 'maxFileSize' => $maxFileSize, 31 'maxChunkSize' => '1600000', 32 'archive' => '../tp/juploader/wjhk.jupload.jar', 33 'afterUploadURL' => 'after_upload.php', 34 'sendMD5Sum' => 'true', 35 'showLogWindow' => 'false', 36 'debugLevel' => 0 37 ); 38 24 39 $classParameters = array( 25 'demo_mode' => false,26 'allow_subdirs' => true,27 'destdir' => '/tmp' //Where to store the files on the webserver28 );40 'demo_mode' => false, 41 'allow_subdirs' => true, 42 'destdir' => '/tmp' //Where to store the files on the webserver 43 ); 29 44 30 45 $juploadPhpSupportClass = new JUpload($appletParameters, $classParameters); … … 33 48 echo '<div align="left"><!--JUPLOAD_APPLET--></div>'; 34 49 35 36 50 ?> -
branches/2.2/filemanager/js/handler.js
r3882 r3889 84 84 folders = unserialize(data); 85 85 86 var rootFold = new dNode({id:'root', caption: get_lang("Directories") 86 var rootFold = new dNode({id:'root', caption: get_lang("Directories")}); 87 87 folders_tree.add(rootFold,'root'); 88 88 … … 237 237 var response = unserialize(data); 238 238 239 if ( response[ 'postsize' ] ) 240 { 241 /* 242 * 243 * response['postize'] = ERRO POST; 244 * response['max_postsize] = diretiva do PHP para POST_MAX_SIZE; 245 * 246 */ 247 248 write_msg( get_lang("ERROR: Use the advanced file sending!") ); 249 return false; 250 } 251 239 252 if ( response[0] != "Ok" ) 240 { 253 { 241 254 for( var i = 0; i < response.length; i++ ) 242 255 { … … 259 272 _div.style.background = "url('"+path_filemanager+"images/warning.gif') no-repeat left top"; 260 273 _div.style.cursor = "pointer"; 261 _div.onclick = function(){ this.style.display = 'none';} ;274 _div.onclick = function(){this.style.display = 'none';} ; 262 275 263 276 if( response[i]['size_max'] ) … … 281 294 { 282 295 _div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: " + response[i]['undefined']; 296 } 297 else if( response[i]['filesize'] ) 298 { 299 _div.innerHTML = "<span style='font-weight:bold' >Erro </span>:: " + response[i]['filesize']; 283 300 } 284 301 } -
branches/2.2/filemanager/setup/phpgw_pt-br.lang
r3885 r3889 47 47 created by filemanager pt-br Criado por 48 48 Error: filemanager pt-br Erro: 49 ERROR: Use the advanced file sending! filemanager pt-br ERRO: Utilize o envio avançado de arquivos! 49 50 Are you sure you want to delete filemanager pt-br Você tem certeza que deseja apagar 50 51 Please type the text "%1" to delete filemanager pt-br Por favor, tenha certeza e digite "%1" para apagar -
branches/2.2/filemanager/templates/default/config.tpl
r3019 r3889 1 1 <!-- BEGIN header --> 2 <script src='filemanager/inc/load_lang.php'></script> 3 <script src='filemanager/js/connector.js'></script> 4 <script src='filemanager/js/common_functions.js'></script> 5 2 6 <form method="POST" action="{action_url}"> 3 <table border="0" align="center"> 4 <tr bgcolor="{th_bg}"> 5 <td colspan="2"><font color="{th_text}"> <b>{title}</b></font></td> 6 </tr> 7 <table border="0" align="center"> 8 <tr bgcolor="{th_bg}"> 9 <td colspan="2"> 10 <font color="{th_text}"> <b>{title}</b></font> 11 </td> 12 </tr> 7 13 <!-- END header --> 8 14 <!-- BEGIN body --> 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 15 <tr bgcolor="{row_on}"> 16 <td>{lang_Max_file_size}</td> 17 <td> 18 <input size="3" name="newsettings[filemanager_Max_file_size]" value="{value_filemanager_Max_file_size}"> Mb 19 </td> 20 </tr> 21 <tr bgcolor="{row_off}"> 22 <td>{lang_quota_size}</td> 23 <td> 24 <input size="3" name="newsettings[filemanager_quota_size]" value="{value_filemanager_quota_size}"> Mb 25 </td> 26 </tr> 27 <tr bgcolor="{row_on}"> 28 <td>{lang_antivirus_command}</td> 29 <td> 30 <input size="40" name="newsettings[filemanager_antivirus_command]" value="{value_filemanager_antivirus_command}"> 31 </td> 32 </tr> 27 33 28 34 <!-- END body --> 29 35 <!-- BEGIN footer --> 30 <tr bgcolor="{th_bg}"> 31 <td colspan="2"> 32 33 </td> 34 </tr> 35 <tr> 36 <td colspan="2" align="center"> 37 <input type="submit" name="submit" value="{lang_submit}"> 38 <input type="submit" name="cancel" value="{lang_cancel}"> 39 </td> 40 </tr> 41 </table> 36 <tr bgcolor="{th_bg}"> 37 <td colspan="2"> </td> 38 </tr> 39 <tr> 40 <td colspan="2" align="center"> 41 <input type="button" value="{lang_submit}" onclick="maxFileSize(document);"> 42 <!-- 43 No MSIE utilizar um botão do tipo submit não permite que seja gravado o arquivo e configuração. 44 Por esse motivo o envio do formulário está sendo feito através do javascript. 45 NÃO REMOVA... 46 --> 47 <input type="submit" name="submit" style="display: none"> 48 <input type="submit" name="cancel" value="{lang_cancel}"> 49 </td> 50 </tr> 51 </table> 42 52 </form> 43 53 <!-- END footer -->
Note: See TracChangeset
for help on using the changeset viewer.