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.
This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.
Table of Contents
Properties
- $CB : array<string|int, mixed>
- Clipboard operations array
- $file : array<string|int, mixed>
- Array of file-operations.
- $fileData : array<string|int, mixed>
- The result array from the file processor
- $fileFactory : ResourceFactory
- $fileProcessor : ExtendedFileUtility
- $iconFactory : IconFactory
- $overwriteExistingFiles : DuplicationBehavior
- Defines behaviour when uploading files with names that already exist; possible values are the values of the \TYPO3\CMS\Core\Resource\DuplicationBehavior enumeration
- $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<string|int, mixed>
- flattenResultDataValue() : bool|string|array<string|int, mixed>
- 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<string|int, mixed>
$CB
$file
Array of file-operations.
protected
array<string|int, mixed>
$file
$fileData
The result array from the file processor
protected
array<string|int, mixed>
$fileData
$fileFactory
protected
ResourceFactory
$fileFactory
$fileProcessor
protected
ExtendedFileUtility
$fileProcessor
$iconFactory
protected
IconFactory
$iconFactory
$overwriteExistingFiles
Defines behaviour when uploading files with names that already exist; possible values are the values of the \TYPO3\CMS\Core\Resource\DuplicationBehavior enumeration
protected
DuplicationBehavior
$overwriteExistingFiles
$redirect
The page where the user should be redirected after everything is done
protected
string
$redirect
$uriBuilder
protected
UriBuilder
$uriBuilder
Methods
__construct()
public
__construct(ResourceFactory $resourceFactory, ExtendedFileUtility $fileProcessor, IconFactory $iconFactory, UriBuilder $uriBuilder) : mixed
Parameters
- $resourceFactory : ResourceFactory
- $fileProcessor : ExtendedFileUtility
- $iconFactory : IconFactory
- $uriBuilder : UriBuilder
fileExistsInFolderAction()
Ajax entry point to check if a file exists in a folder
public
fileExistsInFolderAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfacemainAction()
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
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
ResponseInterfaceflattenFileResultDataValue()
protected
flattenFileResultDataValue(File $result) : array<string|int, mixed>
Parameters
- $result : File
Return values
array<string|int, mixed>flattenResultDataValue()
Flatten result value from FileProcessor
protected
flattenResultDataValue(bool|File|Folder|ProcessedFile $result) : bool|string|array<string|int, mixed>
The value can be a File, Folder or boolean
Parameters
- $result : bool|File|Folder|ProcessedFile
Return values
bool|string|array<string|int, mixed>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
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