Nette\Http\FileUpload::getSize PHP 메소드

getSize() 공개 메소드

Returns the size of an uploaded file.
public getSize ( ) : integer
리턴 integer
    public function getSize()
    {
        return $this->size;
    }

Usage Example

예제 #1
0
파일: Image.php 프로젝트: blitzik/CMS
 public function __construct(FileUpload $file)
 {
     if (!$file->isImage()) {
         throw new NotImageUploadedException();
     }
     $this->id = Uuid::uuid4();
     $pathInfo = pathinfo($file->getSanitizedName());
     if (!isset($pathInfo['extension'])) {
         throw new FileNameException('Filename must have extension');
     }
     $this->extension = $pathInfo['extension'];
     $this->originalName = $pathInfo['filename'];
     $imgSize = $file->getImageSize();
     $this->width = $imgSize[0];
     $this->height = $imgSize[1];
     $this->fileSize = $file->getSize();
     $this->uploadedAt = new \DateTime('now');
 }
All Usage Examples Of Nette\Http\FileUpload::getSize