Exemplo n.º 1
0
 /**
  * This static function is used to perform the actual upload and resizing using the Multup class
  *
  * @return array
  */
 public function doUpload()
 {
     $mimes = $this->getOption('mimes') ? '|mimes:' . $this->getOption('mimes') : '';
     //use the multup library to perform the upload
     $result = Multup::open('file', 'max:' . $this->getOption('size_limit') * 1000 . $mimes, $this->getOption('location'), $this->getOption('naming') === 'random')->set_length($this->getOption('length'))->upload();
     return $result[0];
 }
 /**
  * This static function is used to perform the actual upload and resizing using the Multup class
  *
  * @return array
  */
 public function doUpload()
 {
     //use the multup library to perform the upload
     $result = Multup::open('file', 'image|max:' . $this->getOption('size_limit') * 1000, $this->getOption('location'), $this->getOption('naming') === 'random')->sizes($this->getOption('sizes'))->set_length($this->getOption('length'))->upload();
     // dd($result);
     return $result[0];
 }
Exemplo n.º 3
0
 /**
  * This static function is used to perform the actual upload and resizing using the Multup class.
  *
  * @return array
  */
 public function doUpload()
 {
     // CJ: Create a folder if it doesn't already exist
     if (!file_exists($this->getOption('location'))) {
         mkdir($this->getOption('location'), 0777, true);
     }
     //use the multup library to perform the upload
     $result = Multup::open('file', 'image|max:' . $this->getOption('size_limit') * 1000, $this->getOption('location'), $this->getOption('naming') === 'random')->sizes($this->getOption('sizes'))->set_length($this->getOption('length'))->upload();
     return $result[0];
 }