Ejemplo n.º 1
0
 /**
  * Returns the maximum accepted file size
  * 
  * @return int
  */
 public function maxSize()
 {
     $sizes = array(detect::maxPostSize(), detect::maxUploadSize());
     if ($this->options['maxSize']) {
         $sizes[] = $this->options['maxSize'];
     }
     return min($sizes);
 }
Ejemplo n.º 2
0
 public function __construct($to, $params = array())
 {
     $defaults = array('input' => 'file', 'to' => $to, 'overwrite' => true, 'maxSize' => detect::maxUploadSize(), 'accept' => null);
     $this->options = array_merge($defaults, $params);
     try {
         $this->move();
         $this->file = new Media($this->to());
     } catch (Exception $e) {
         $this->error = $e;
     }
 }