‪TYPO3CMS  11.5
TYPO3\CMS\Backend\Controller\File\FileController Class Reference

Public Member Functions

 __construct (ResourceFactory $resourceFactory, ExtendedFileUtility $fileProcessor, IconFactory $iconFactory, UriBuilder $uriBuilder)
 
ResponseInterface mainAction (ServerRequestInterface $request)
 
ResponseInterface processAjaxRequest (ServerRequestInterface $request)
 
ResponseInterface fileExistsInFolderAction (ServerRequestInterface $request)
 

Protected Member Functions

 init (ServerRequestInterface $request)
 
 initClipboard (ServerRequestInterface $request)
 
 main ()
 
string null getFileEditRedirect (File $file)
 
 flattenFileResultDataValue (File $result)
 
bool string array flattenResultDataValue ($result)
 
 setPasteCmd (Clipboard $clipboard)
 
 setDeleteCmd (Clipboard $clipObj)
 

Protected Attributes

array $file
 
array $CB
 
DuplicationBehavior $overwriteExistingFiles
 
string $redirect
 
array $fileData
 
ExtendedFileUtility $fileProcessor
 
ResourceFactory $fileFactory
 
IconFactory $iconFactory
 
UriBuilder $uriBuilder
 

Detailed Description

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.

Definition at line 47 of file FileController.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Controller\File\FileController::__construct ( ResourceFactory  $resourceFactory,
ExtendedFileUtility  $fileProcessor,
IconFactory  $iconFactory,
UriBuilder  $uriBuilder 
)

Member Function Documentation

◆ fileExistsInFolderAction()

ResponseInterface TYPO3\CMS\Backend\Controller\File\FileController::fileExistsInFolderAction ( ServerRequestInterface  $request)

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

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 182 of file FileController.php.

References TYPO3\CMS\Backend\Controller\File\FileController\flattenFileResultDataValue(), and TYPO3\CMS\Backend\Controller\File\FileController\init().

◆ flattenFileResultDataValue()

◆ flattenResultDataValue()

bool string array TYPO3\CMS\Backend\Controller\File\FileController::flattenResultDataValue (   $result)
protected

Flatten result value from FileProcessor

The value can be a File, Folder or boolean

Parameters
bool | File | Folder | ProcessedFile$result
Returns
‪bool|string|array

Definition at line 320 of file FileController.php.

References TYPO3\CMS\Backend\Controller\File\FileController\flattenFileResultDataValue().

Referenced by TYPO3\CMS\Backend\Controller\File\FileController\processAjaxRequest().

◆ getFileEditRedirect()

string null TYPO3\CMS\Backend\Controller\File\FileController::getFileEditRedirect ( File  $file)
protected

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

Parameters
File$file‪to be edited
Returns
‪string|null URI to be redirected to
Exceptions
RouteNotFoundException

Definition at line 271 of file FileController.php.

References TYPO3\CMS\Backend\Controller\File\FileController\$file, TYPO3\CMS\Core\Resource\AbstractFile\$properties, and TYPO3\CMS\Backend\Controller\File\FileController\$redirect.

Referenced by TYPO3\CMS\Backend\Controller\File\FileController\mainAction().

◆ init()

TYPO3\CMS\Backend\Controller\File\FileController::init ( ServerRequestInterface  $request)
protected

◆ initClipboard()

TYPO3\CMS\Backend\Controller\File\FileController::initClipboard ( ServerRequestInterface  $request)
protected

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

Definition at line 236 of file FileController.php.

References TYPO3\CMS\Backend\Controller\File\FileController\setDeleteCmd(), and TYPO3\CMS\Backend\Controller\File\FileController\setPasteCmd().

Referenced by TYPO3\CMS\Backend\Controller\File\FileController\init().

◆ main()

TYPO3\CMS\Backend\Controller\File\FileController::main ( )
protected

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

Definition at line 256 of file FileController.php.

Referenced by TYPO3\CMS\Backend\Controller\File\FileController\mainAction(), and TYPO3\CMS\Backend\Controller\File\FileController\processAjaxRequest().

◆ mainAction()

ResponseInterface TYPO3\CMS\Backend\Controller\File\FileController::mainAction ( ServerRequestInterface  $request)

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.

Parameters
ServerRequestInterface$request‪the current request
Returns
‪ResponseInterface the response with the content
Exceptions
RouteNotFoundException

Definition at line 101 of file FileController.php.

References TYPO3\CMS\Backend\Controller\File\FileController\$file, TYPO3\CMS\Backend\Controller\File\FileController\$redirect, TYPO3\CMS\Backend\Controller\File\FileController\getFileEditRedirect(), TYPO3\CMS\Backend\Controller\File\FileController\init(), and TYPO3\CMS\Backend\Controller\File\FileController\main().

◆ processAjaxRequest()

ResponseInterface TYPO3\CMS\Backend\Controller\File\FileController::processAjaxRequest ( ServerRequestInterface  $request)

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

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 133 of file FileController.php.

References $errors, TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR, TYPO3\CMS\Backend\Controller\File\FileController\flattenResultDataValue(), TYPO3\CMS\Backend\Controller\File\FileController\init(), and TYPO3\CMS\Backend\Controller\File\FileController\main().

◆ setDeleteCmd()

TYPO3\CMS\Backend\Controller\File\FileController::setDeleteCmd ( Clipboard  $clipObj)
protected

◆ setPasteCmd()

TYPO3\CMS\Backend\Controller\File\FileController::setPasteCmd ( Clipboard  $clipboard)
protected

Member Data Documentation

◆ $CB

array TYPO3\CMS\Backend\Controller\File\FileController::$CB
protected

Clipboard operations array

Definition at line 59 of file FileController.php.

◆ $file

array TYPO3\CMS\Backend\Controller\File\FileController::$file
protected

◆ $fileData

array TYPO3\CMS\Backend\Controller\File\FileController::$fileData
protected

The result array from the file processor

Definition at line 78 of file FileController.php.

◆ $fileFactory

ResourceFactory TYPO3\CMS\Backend\Controller\File\FileController::$fileFactory
protected

Definition at line 81 of file FileController.php.

◆ $fileProcessor

ExtendedFileUtility TYPO3\CMS\Backend\Controller\File\FileController::$fileProcessor
protected

◆ $iconFactory

IconFactory TYPO3\CMS\Backend\Controller\File\FileController::$iconFactory
protected

◆ $overwriteExistingFiles

DuplicationBehavior TYPO3\CMS\Backend\Controller\File\FileController::$overwriteExistingFiles
protected

Defines behaviour when uploading files with names that already exist; possible values are the values of the \TYPO3\CMS\Core\Resource\DuplicationBehavior enumeration

Definition at line 66 of file FileController.php.

◆ $redirect

string TYPO3\CMS\Backend\Controller\File\FileController::$redirect
protected

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

Definition at line 72 of file FileController.php.

Referenced by TYPO3\CMS\Backend\Controller\File\FileController\getFileEditRedirect(), and TYPO3\CMS\Backend\Controller\File\FileController\mainAction().

◆ $uriBuilder

UriBuilder TYPO3\CMS\Backend\Controller\File\FileController::$uriBuilder
protected