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

Public Member Functions

ResponseInterface mainAction (ServerRequestInterface $request)
 
ResponseInterface processAjaxRequest (ServerRequestInterface $request)
 
ResponseInterface fileExistsInFolderAction (ServerRequestInterface $request)
 

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
 

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

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

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

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

References 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 305 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 244 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 ( )
protected

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

Definition at line 208 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 228 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

Definition at line 94 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(), 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.

Parameters
ServerRequestInterface$request
Returns
‪ResponseInterface

Definition at line 126 of file FileController.php.

References $errors, TYPO3\CMS\Backend\Controller\File\FileController\flattenResultDataValue(), TYPO3\CMS\Backend\Controller\File\FileController\init(), 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 58 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 84 of file FileController.php.

◆ $fileProcessor

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

Internal, dynamic: File processor object

Definition at line 78 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 65 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 71 of file FileController.php.

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