Example #1
0
 /**
  * Returns a normalized array with file information where each entry of the array
  * is a set of all information known about one file if the FILES field has an array markup
  * like field_name[]
  * @param string $name The name of the file field
  * @return array Returns an array with the information about the files
  */
 protected function getFilesNormalized($name)
 {
     $files = array();
     if (isset($this->files[$name]) === false) {
         return $files;
     }
     $filesArr = $this->files[$name];
     $filesCount = count($filesArr['name']);
     for ($i = 0; $i < $filesCount; ++$i) {
         $files[] = File::createFromArray(array('name' => $filesArr['name'][$i], 'type' => $filesArr['type'][$i], 'tmp_name' => $filesArr['tmp_name'][$i], 'error' => $filesArr['error'][$i], 'size' => $filesArr['size'][$i]));
     }
     return $files;
 }