MetaFoxFileTypeInterface
in
Table of Contents
Methods
- getAllowableTypes() : array<string|int, string>
- getFilesizeInMegabytes() : float
- getFilesizePerType() : int
- This method return how many bytes should a type can be uploaded to server.
- getFilesizeReadableString() : string
- getMimeTypeFromType() : string
- getTypeByMime() : string|null
- isAllowType() : bool
- transformFileType() : string
- verifyMime() : bool
- verifyMimeTypeByType() : bool
Methods
getAllowableTypes()
public
getAllowableTypes(string $type, bool $useConverter) : array<string|int, string>
Parameters
- $type : string
- $useConverter : bool
Return values
array<string|int, string>getFilesizeInMegabytes()
public
getFilesizeInMegabytes(string $type) : float
Parameters
- $type : string
Return values
floatgetFilesizePerType()
This method return how many bytes should a type can be uploaded to server.
public
getFilesizePerType(string $type) : int
Parameters
- $type : string
Return values
intgetFilesizeReadableString()
public
getFilesizeReadableString(int $bytes) : string
Parameters
- $bytes : int
Return values
stringgetMimeTypeFromType()
public
getMimeTypeFromType(string $type[, bool $useConverter = true ]) : string
Parameters
- $type : string
- $useConverter : bool = true
Return values
stringgetTypeByMime()
public
getTypeByMime(string|null $mimeType) : string|null
Parameters
- $mimeType : string|null
Return values
string|nullisAllowType()
public
isAllowType(string $type) : bool
Parameters
- $type : string
Return values
booltransformFileType()
public
transformFileType(string $fileType) : string
Parameters
- $fileType : string
Return values
stringverifyMime()
public
verifyMime(UploadedFile $file, string $type) : bool
Parameters
- $file : UploadedFile
- $type : string
Return values
boolverifyMimeTypeByType()
public
verifyMimeTypeByType(string|null $mimeType[, string $fileType = 'photo' ]) : bool
Parameters
- $mimeType : string|null
- $fileType : string = 'photo'