FileController

class \TYPO3\CMS\Backend\Controller\File\FileController

Gateway for TCE (TYPO3 Core Engine) file-handling through POST forms.

This script serves as the file administration part of the TYPO3 Core Engine. Basically it includes two libraries which are used to manipulate files on the server.

Attributes

#[AsController]

Table of Contents

Properties

$CB  : array
Clipboard operations array
$file  : array
Array of file-operations.
$fileData  : array
The result array from the file processor
$fileFactory  : ResourceFactory
$fileProcessor  : ExtendedFileUtility
$flashMessageService  : FlashMessageService
$iconFactory  : IconFactory
$overwriteExistingFiles  : DuplicationBehavior
Defines behaviour when uploading files with names that already exist.
$redirect  : string
The page where the user should be redirected after everything is done
$uriBuilder  : UriBuilder

Methods

__construct()  : mixed
fileExistsInFolderAction()  : ResponseInterface
Ajax entry point to check if a file exists in a folder
mainAction()  : ResponseInterface
Injects the request object for the current request or subrequest As this controller goes only through the main() method, it just redirects to the given URL afterwards.
processAjaxRequest()  : ResponseInterface
Handles the actual process from within the ajaxExec function therefore, it does exactly the same as the real typo3/tce_file.php.
flattenFileResultDataValue()  : array
flattenResultDataValue()  : bool|string|array
Flatten result value from FileProcessor
getFileEditRedirect()  : string|null
Gets URI to be used for editing given file (if file extension is defined in textfile_ext)
init()  : void
Registering incoming data
initClipboard()  : void
Initialize the Clipboard. This will fetch the data about files to paste/delete if such an action has been sent.
main()  : void
Performing the file admin action: Initializes the objects, setting permissions, sending data to object.
setDeleteCmd()  : void
Applies the proper delete configuration to $this->file
setPasteCmd()  : void
Applies the proper paste configuration to $this->file

Properties

$CB

Clipboard operations array

protected array $CB

$file

Array of file-operations.

protected array $file

$fileData

The result array from the file processor

protected array $fileData

$overwriteExistingFiles

Defines behaviour when uploading files with names that already exist.

protected DuplicationBehavior $overwriteExistingFiles

$redirect

The page where the user should be redirected after everything is done

protected string $redirect

Methods

fileExistsInFolderAction()

Ajax entry point to check if a file exists in a folder

public fileExistsInFolderAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

mainAction()

Injects the request object for the current request or subrequest As this controller goes only through the main() method, it just redirects to the given URL afterwards.

public mainAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

the current request

Tags

throws
RouteNotFoundException

Return values

ResponseInterface —

the response with the content

processAjaxRequest()

Handles the actual process from within the ajaxExec function therefore, it does exactly the same as the real typo3/tce_file.php.

public processAjaxRequest(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

flattenFileResultDataValue()

protected flattenFileResultDataValue(File $result) : array

Parameters

$result : File

Return values

array

flattenResultDataValue()

Flatten result value from FileProcessor

protected flattenResultDataValue(bool|File|Folder|ProcessedFile $result) : bool|string|array

The value can be a File, Folder or boolean

Parameters

$result : bool|File|Folder|ProcessedFile

Return values

bool|string|array

getFileEditRedirect()

Gets URI to be used for editing given file (if file extension is defined in textfile_ext)

protected getFileEditRedirect(File $file) : string|null

Parameters

$file : File

to be edited

Tags

throws
RouteNotFoundException

Return values

string|null —

URI to be redirected to

init()

Registering incoming data

protected init(ServerRequestInterface $request) : void

Parameters

$request : ServerRequestInterface

initClipboard()

Initialize the Clipboard. This will fetch the data about files to paste/delete if such an action has been sent.

protected initClipboard(ServerRequestInterface $request) : void

Parameters

$request : ServerRequestInterface

main()

Performing the file admin action: Initializes the objects, setting permissions, sending data to object.

protected main() : void

setDeleteCmd()

Applies the proper delete configuration to $this->file

protected setDeleteCmd(Clipboard $clipObj) : void

Parameters

$clipObj : Clipboard

setPasteCmd()

Applies the proper paste configuration to $this->file

protected setPasteCmd(Clipboard $clipboard) : void

Parameters

$clipboard : Clipboard
On this page