public function setMaxSize($maxSize) { $this->maxSize = is_numeric($maxSize) ? $maxSize : Util::humanReadableToBytes($maxSize); if ($this->maxSize < 0 || $this->maxSize == null) { throw new \Exception('invalid maxSize value'); } }
/** * Sets the max file size * @param mixed $max_size * @throws \Exception if the max_size value is invalid */ public function setMaxSize($max_size) { if (is_numeric($max_size)) { $this->max_size = $max_size; } else { $this->max_size = Util::humanReadableToBytes($max_size); } if ($this->max_size < 0 || $this->max_size == null) { throw new \Exception('invalid max_size value'); } }
/** * @param $minSize * @return int|string * @throws \Exception if the file size is lesser than zero or null */ public function setMinFile($minSize) { $min = 0; if (is_numeric($minSize)) { $min = $minSize; } else { $min = Util::humanReadableToBytes($minSize); } if ($min < 0 || $min === null) { throw new \Exception("Invalid File Min_Size"); } return $min; }