Go to the documentation of this file.00001 <?php
00010 class helper_file extends object {
00011
00019 public function valid(array $file, array $prm = array()) {
00020 if (empty($file) || (isset($file['size']) && $file['size'] == 0))
00021 return true;
00022
00023 $type = $file['type'] != 'application/octet-stream' ? $file['type'] : file::getType($file['name']);
00024 return (!$this->cfg->maxsize || $file['size'] < $this->cfg->maxsize) && (count($this->cfg->mime) == 0 || in_array($type, $this->cfg->mime));
00025 }
00026
00027 }