When using the FAL API to add a file to a folder,
the local file is deleted by default already.
Thus the attempt to remove the file again results in a warning.
Therefore remove the obsolete unlink to avoid the warning.
Resolves: #87192
Releases: 8.7, 9.5, master
Change-Id: I23f3192e2760cd705429337464c8a5506cf41205
Reviewed-on: https://review.typo3.org/59186
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
$temporaryFile = GeneralUtility::tempnam('online_media');
GeneralUtility::writeFileToTypo3tempDir($temporaryFile, $onlineMediaId);
$file = $targetFolder->addFile($temporaryFile, $fileName, DuplicationBehavior::RENAME);
- GeneralUtility::unlink_tempfile($temporaryFile);
return $file;
}