Beispiel #1
0
 /**
  * Saves an file posted from a multipart form.
  *
  * @param $name string The name of the field posted in $_FILES.
  *
  * @return object This current object. Used to check if there was an error
  *      or get the returned id.
  */
 public function save($name)
 {
     $response = Media_Uploader::save($name, $this->_type, $this->_allowedExts);
     if (!$response) {
         $this->_error = Media_Uploader::getError();
     } else {
         $this->_id = $response;
     }
     return $this;
 }
Beispiel #2
0
 /**
  * Saves an image posted from a multipart form.
  *
  * @param $name string The name of the field posted in $_FILES.
  *
  * @return object This current object. Used to check if there was an error
  *      or get the returned id.
  */
 public function save($name)
 {
     $response = Media_Uploader::save($name, 'image', Config::get('media.allowed_image_formats'));
     if (!$response) {
         $this->_error = Media_Uploader::getError();
     } else {
         $this->_id = $response;
     }
     return $this;
 }