Project

General

Profile

Actions

Feature #62091

open

Add conflict handling to FAL create methods

Added by Simon Praetorius about 10 years ago. Updated about 6 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2014-10-07
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

When adding files to a FAL file storage with addFile() the $conflictMode parameter allows to handle file name conflicts easily (cancel, replace or renameNewFile). It would be nice if that conflict handling could be provided for create methods as well. In my case I want to add files from remote servers to a file storage, but with their original file name:

$url = 'http://example.com/file.ext';
$filename = basename($url);
$content = GeneralUtility::getUrl($url);

$storage = $storageRepository->findByUid(1);
$folder = $storage->getFolder('1:myFolder');

$folder->createFile($filename)->setContents($content);

Currently there seems to be no proper way to rename a new name automatically if another file with the same name already exists. With the proposed change the last line could look like this:

$folder->createFile($filename, 'renameNewFile')->setContents($content);

I think that this would be helpful for folders as well (createFolder()).


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #64363: Copy files in Filelist backendAccepted2015-01-19

Actions
Actions #1

Updated by Frans Saris about 10 years ago

  • Status changed from New to Accepted
Actions #2

Updated by Gerrit Code Review over 6 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56815

Actions #3

Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56815

Actions #4

Updated by Anja Leichsenring about 6 years ago

  • Status changed from Under Review to New
Actions

Also available in: Atom PDF