示例#1
0
 public function fillFileUpload(IFileUpload $fileUpload)
 {
     $this->name = $fileUpload->getName();
     $this->size = $fileUpload->getSize();
     $this->content_type = $fileUpload->getContentType();
     $this->is_image = $fileUpload->isImage();
     if (is_null($this->UID)) {
         $this->generateUID();
     }
     $fullPath = $this->storage_path . DIRECTORY_SEPARATOR . $this->UID;
     $fileUpload->moveTo($fullPath);
     $this->full_path = $fullPath;
 }
示例#2
0
 public function fillFileUpload(IFileUpload $fileUpload)
 {
     $this->name = $fileUpload->getName();
     $this->size = $fileUpload->getSize();
     $this->content_type = $fileUpload->getContentType();
     $this->is_image = true;
     if (is_null($this->UID)) {
         $this->generateUID();
     }
     $fullPath = $this->storage_path . DIRECTORY_SEPARATOR . $this->UID;
     $fileUpload->moveTo($fullPath);
     $this->full_path = $fullPath;
     $image = self::createResource($fullPath);
     $this->setImageResource($image);
     imagesavealpha($image, TRUE);
 }