Changeset 1068
- Timestamp:
- 12/10/09 20:29:47 (2 years ago)
- Location:
- trunk/www/controllers
- Files:
-
- 2 edited
-
attachment.php (modified) (2 diffs)
-
zip_attachment.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/controllers/attachment.php
r1034 r1068 109 109 if (!$form_errors) { 110 110 if ($autoextract) { 111 $ attachments = get_zipped_attachments($_FILES['file_name']['tmp_name']);112 113 if (false === $ attachments) {111 $zip_files = get_zipped_attachments($_FILES['file_name']['tmp_name']); 112 113 if (false === $zip_files) { 114 114 $form_errors['file_name'] = 'Arhiva ZIP este invalida sau nu poate fi recunoscuta'; 115 } else { 116 $attachments = $zip_files['attachments']; 117 $skipped_files = $zip_files['total_files'] - count($attachments); 115 118 } 116 119 } … … 232 235 if (!$form_errors) { 233 236 if ($autoextract) { 234 $msg = "Am extras si incarcat {$attach_okcount} fisiere."; 235 if ($rewrite_count) { 236 $msg .= " {$rewrite_count} fisiere vechi au fost rescrise."; 237 if ($attach_okcount == 1) { 238 $msg = "Am extras si incarcat un fisier."; 239 } else { 240 $msg = "Am extras si incarcat {$attach_okcount} fisiere."; 241 } 242 243 if ($rewrite_count == 1) { 244 $msg .= " Un fisier mai vechi a fost rescris."; 245 } else if ($rewrite_count > 1) { 246 $msg .= " {$rewrite_count} fisiere mai vechi au fost rescrise."; 247 } 248 249 if ($skipped_files == 1) { 250 $msg .= " Un fisier nu a fost dezarhivat deoarece era prea mare sau era invalid."; 251 } else if ($skipped_files > 1) { 252 $msg .= " {$skipped_files} fisiere nu au fost dezarhivate deoarece erau prea mari sau erau invalide."; 237 253 } 238 254 } -
trunk/www/controllers/zip_attachment.php
r900 r1068 7 7 $attachments = array(); 8 8 $namehash = array(); 9 $total_files = 0; 9 10 10 11 log_print('Exploring ZIP archive '.$filename); … … 24 25 } 25 26 27 $total_files++; 28 // Skip big files 29 if ($stat['size'] > IA_ATTACH_MAXSIZE) { 30 continue; 31 } 32 26 33 // validate file name and make sure there are no duplicates 27 34 $aname = basename($stat['name']); … … 37 44 $zip->close(); 38 45 } 39 return $attachments;46 return array('total_files' => $total_files, 'attachments' => $attachments); 40 47 } 41 48
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)