fix(legacy): prepend file id in tmp upload filename (#2173)

Fix #1880
This commit is contained in:
Jonas L 2022-09-21 14:04:11 +02:00 committed by GitHub
parent 6b16df8966
commit 5cd2c5263e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -913,12 +913,13 @@ SQL;
* @param string $tempFilePath
* @param string $originalFilename
* @param bool $copyFile copy the file instead of moving it
* @param mixed $fileId
*
* @return Ambigous <unknown, string>
*
* @throws Exception
*/
public static function moveFileToStor($tempFilePath, $originalFilename, $copyFile = false)
public static function moveFileToStor($tempFilePath, $fileId, $originalFilename, $copyFile = false)
{
$audio_file = $tempFilePath;
@ -938,7 +939,7 @@ SQL;
$audio_stor = Application_Common_OsPath::join(
$stor,
'organize',
$originalFilename
$fileId . '-' . $originalFilename
);
// if the uploaded file is not UTF-8 encoded, let's encode it. Assuming source
// encoding is ISO-8859-1

View File

@ -29,7 +29,7 @@ class Application_Service_MediaService
// Copy the temporary file over to the "organize" folder so that it's off our webserver
// and accessible by libretime-analyzer which could be running on a different machine.
$newTempFilePath = Application_Model_StoredFile::moveFileToStor($filePath, $originalFilename, $copyFile);
$newTempFilePath = Application_Model_StoredFile::moveFileToStor($filePath, $fileId, $originalFilename, $copyFile);
// Dispatch a message to libretime-analyzer through RabbitMQ,
// notifying it that there's a new upload to process!