class FileUploadResult (View source)

Value object for a file upload result.

Properties

protected bool $securityRename

If the filename was renamed for security reasons.

protected string $sanitizedFilename

The sanitized filename.

protected string $originalFilename

The original filename.

protected FileInterface $file

The File entity.

Methods

setSecurityRename()

Flags the result as having had a security rename.

setSanitizedFilename(string $sanitizedFilename)

Sets the sanitized filename.

string
getOriginalFilename()

Gets the original filename.

setOriginalFilename(string $originalFilename)

Sets the original filename.

setFile(FileInterface $file)

Sets the File entity.

bool
isSecurityRename()

Returns if there was a security rename.

bool
isRenamed()

Returns if there was a file rename.

string
getSanitizedFilename()

Gets the sanitized filename.

getFile()

Gets the File entity.

Details

FileUploadResult setSecurityRename()

Flags the result as having had a security rename.

Return Value

FileUploadResult

FileUploadResult setSanitizedFilename(string $sanitizedFilename)

Sets the sanitized filename.

Parameters

string $sanitizedFilename

The sanitized filename.

Return Value

FileUploadResult

string getOriginalFilename()

Gets the original filename.

Return Value

string

FileUploadResult setOriginalFilename(string $originalFilename)

Sets the original filename.

Parameters

string $originalFilename

The original filename.

Return Value

FileUploadResult

FileUploadResult setFile(FileInterface $file)

Sets the File entity.

Parameters

FileInterface $file

A file entity.

Return Value

FileUploadResult

bool isSecurityRename()

Returns if there was a security rename.

Return Value

bool

bool isRenamed()

Returns if there was a file rename.

Return Value

bool

string getSanitizedFilename()

Gets the sanitized filename.

Return Value

string

FileInterface getFile()

Gets the File entity.

Return Value

FileInterface