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

Public Member Functions

 __construct (protected readonly ResourceFactory $fileFactory, protected readonly ExtendedFileUtility $fileProcessor, protected readonly IconFactory $iconFactory, protected readonly UriBuilder $uriBuilder, protected readonly FlashMessageService $flashMessageService)
 
ResponseInterface mainAction (ServerRequestInterface $request)
 
 processAjaxRequest (ServerRequestInterface $request)
 
 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
 

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

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Controller\File\FileController::__construct ( protected readonly ResourceFactory  $fileFactory,
protected readonly ExtendedFileUtility  $fileProcessor,
protected readonly IconFactory  $iconFactory,
protected readonly UriBuilder  $uriBuilder,
protected readonly FlashMessageService  $flashMessageService 
)

Definition at line 80 of file FileController.php.

Member Function Documentation

◆ fileExistsInFolderAction()

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

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

Definition at line 164 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 301 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 252 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()

◆ 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 217 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 237 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 96 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()

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.

Definition at line 125 of file FileController.php.

References 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 61 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.

◆ $overwriteExistingFiles

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

Defines behaviour when uploading files with names that already exist.

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().