19 public function valid(array $file, array $prm = array()) {
20 if (empty($file) || (isset($file[
'size']) && $file[
'size'] == 0))
23 if ($this->cfg->maxsize && $file[
'size'] > $this->cfg->maxsize)
24 return sprintf($this->cfg->getInArray(
'validErrors',
'maxsize'),
'%s',
file::humanSize($this->cfg->maxsize,
true));
26 $type = $file[
'type'] !=
'application/octet-stream' ? $file[
'type'] :
file::getType($file[
'name']);
27 if (count($this->cfg->mime) > 0 && !in_array($type, $this->cfg->mime))
28 return $this->cfg->getInArray(
'validErrors',
'mime');
static humanSize($file, $sizeGiven=false)
valid(array $file, array $prm=array())