‪TYPO3CMS  9.5
TYPO3\CMS\Backend\Controller\File\FileController Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Controller\File\FileController:
TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait

Public Member Functions

 __construct ()
 
ResponseInterface mainAction (ServerRequestInterface $request)
 
ResponseInterface processAjaxRequest (ServerRequestInterface $request)
 
ResponseInterface fileExistsInFolderAction (ServerRequestInterface $request)
 
 finish ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait
mixed __call (string $methodName, array $arguments)
 

Protected Member Functions

 init (ServerRequestInterface $request)
 
 initClipboard ()
 
 main ()
 
string null getFileEditRedirect (File $file)
 
bool string array flattenResultDataValue ($result)
 
BackendUserAuthentication getBackendUser ()
 

Protected Attributes

array $file
 
array $CB
 
TYPO3 CMS Core Resource DuplicationBehavior $overwriteExistingFiles
 
string $redirect
 
ExtendedFileUtility $fileProcessor
 
array $fileData
 

Private Attributes

array $deprecatedPublicMethods
 

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 45 of file FileController.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Controller\File\FileController::__construct ( )

Constructor

Definition at line 96 of file FileController.php.

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

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 170 of file FileController.php.

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

◆ finish()

TYPO3\CMS\Backend\Controller\File\FileController::finish ( )

Redirecting the user after the processing has been done. Might also display error messages directly, if any.

Deprecated:
‪since TYPO3 v9. Will be removed in TYPO3 v10.0.

Definition at line 280 of file FileController.php.

References TYPO3\CMS\Core\Utility\HttpUtility\redirect(), and TYPO3\CMS\Backend\Utility\BackendUtility\setUpdateSignal().

◆ 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$result
Returns
‪bool|string|array

Definition at line 298 of file FileController.php.

References $GLOBALS, TYPO3\CMS\Core\Resource\ProcessedFile\CONTEXT_IMAGEPREVIEW, TYPO3\CMS\Backend\Utility\BackendUtility\date(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

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

◆ getBackendUser()

BackendUserAuthentication TYPO3\CMS\Backend\Controller\File\FileController::getBackendUser ( )
protected

Returns the current BE user.

Returns
‪BackendUserAuthentication

Definition at line 329 of file FileController.php.

References $GLOBALS.

◆ 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

Definition at line 257 of file FileController.php.

References TYPO3\CMS\Backend\Controller\File\FileController\$file, $GLOBALS, 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

Registering incoming data

Parameters
ServerRequestInterface$request

Definition at line 191 of file FileController.php.

References TYPO3\CMS\Core\Type\Enumeration\cast(), and TYPO3\CMS\Backend\Controller\File\FileController\initClipboard().

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

◆ initClipboard()

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

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

Definition at line 221 of file FileController.php.

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 241 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

Definition at line 109 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\main(), and TYPO3\CMS\Backend\Utility\BackendUtility\setUpdateSignal().

◆ 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 but without calling the "finish" method, thus makes it simpler to deal with the actual return value

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 142 of file FileController.php.

References $errors, TYPO3\CMS\Backend\Controller\File\FileController\flattenResultDataValue(), and TYPO3\CMS\Backend\Controller\File\FileController\main().

Member Data Documentation

◆ $CB

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

Clipboard operations array

Definition at line 65 of file FileController.php.

◆ $deprecatedPublicMethods

array TYPO3\CMS\Backend\Controller\File\FileController::$deprecatedPublicMethods
private
Initial value:
= array(
'initClipboard' => 'Using FileController::initClipboard() is deprecated and will not be possible anymore in TYPO3 v10.0.',
'main' => 'Using FileController::main() is deprecated and will not be possible anymore in TYPO3 v10.0.',
)

Definition at line 50 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 91 of file FileController.php.

◆ $fileProcessor

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

Internal, dynamic: File processor object

Definition at line 85 of file FileController.php.

◆ $overwriteExistingFiles

TYPO3 CMS Core Resource 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 72 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 78 of file FileController.php.

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