Actions
Feature #62091
openAdd conflict handling to FAL create methods
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()).
Actions