ILIAS  release_8 Revision v8.24
Metadata.php
Go to the documentation of this file.
1<?php
2
4
7use ILIAS\FileUpload\ScalarTypeCheckAware;
8
21final class Metadata
22{
23 use ScalarTypeCheckAware;
24 private string $filename;
25 private int $uploadSize;
26 private string $mimeType;
28
29
41 public function __construct(string $filename, int $size, string $mimeType)
42 {
43 $this->stringTypeCheck($filename, "filename");
44 $this->intTypeCheck($size, "size");
45 $this->stringTypeCheck($mimeType, "mimeType");
46
47 $this->filename = $filename;
48 $this->uploadSize = $size;
49 $this->mimeType = $mimeType;
51 }
52
53
60 public function getFilename(): string
61 {
62 return $this->filename;
63 }
64
65
73 public function setFilename(string $filename): self
74 {
75 $this->stringTypeCheck($filename, "filename");
76
77 $this->filename = $filename;
78
79 return $this;
80 }
81
82
90 public function getUploadSize(): int
91 {
92 return $this->uploadSize;
93 }
94
95
102 public function getMimeType(): string
103 {
104 return $this->mimeType;
105 }
106
107
115 public function setMimeType(string $mimeType): self
116 {
117 $this->stringTypeCheck($mimeType, "mimeType");
118
119 $this->mimeType = $mimeType;
120
121 return $this;
122 }
123
124
131 public function additionalMetaData(): StringMap
132 {
134 }
135}
__construct(string $filename, int $size, string $mimeType)
Metadata constructor.
Definition: Metadata.php:41
getFilename()
The filename supplied by the browser.
Definition: Metadata.php:60
setFilename(string $filename)
Overwrite the current filename.
Definition: Metadata.php:73
getMimeType()
Client supplied mime type of the uploaded.
Definition: Metadata.php:102
additionalMetaData()
Provides a string map implementation which allows the processors to store additional values.
Definition: Metadata.php:131
setMimeType(string $mimeType)
Overwrite the current mime type of the file.
Definition: Metadata.php:115
getUploadSize()
This is always the original file size which was determined by the http service.
Definition: Metadata.php:90
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Metadata.php:3