Beispiel #1
0
         $sizeLimit = $fs->returnBytes($EDITOR->maxDocSize);
         break;
     case 'media':
         $extensions = $EDITOR->allowedMediaExtensions;
         $sizeLimit = $fs->returnBytes($EDITOR->maxMediaSize);
         break;
 }
 $overwrite = false;
 if ($dir->overwrite) {
     if (isset($params['overwrite'])) {
         if ($params['overwrite']) {
             $overwrite = true;
         }
     }
 }
 if ($errors = $fs->uploadFiles('files', $directory, $extensions, $dir->filters, $sizeLimit, $overwrite, $chkimgwidth, $maxwidth, $maxheight, $EDITOR->fileCHMOD)) {
     /*$errors = array();
     		$errors['fatal'] = array(); // an array of files that failed to upload
     		$errors['resized'] = array(); // images resized to maximum allowed size
     		$errors['renamed'] = array(); // an array of files which had to be slightly re-named
     		$errors['overwrite'] = array(); // an array of files where a file with that name already exists
     		$errors['succeeded'] = array(); // array of files successfully uploaded, if files were renamed this has the renamed name not the original.
     		*/
     //echo '<pre>';
     //print_r($errors);
     if (!empty($errors['resized'])) {
         foreach ($errors['resized'] as $file => $array) {
             if ($file != basename($array[2])) {
                 if (isset($errors['overwrite'][$file])) {
                     $errors['overwrite'][$file] = basename($array[2]);
                 }