Craft adds unwanted date to filename How to remove the date behind a asset filename or prevent add a date behind the filename? I'll have a plugin that's modifies an existing pdf with SETA SIGN. To do so I'm copy the current asset, modify it in the temp folder, unlink original, copy modified file and unlink the temp file. I tried to rename the file (with $rename) but still the date is added behind the filename. I'll found something with avoidFilenameConflicts but as far as I'll see this is for new assets not for moving or renaming assets.
$assetFilePath = $asset-&gt;getVolume()-&gt;getRootPath() . DIRECTORY_SEPARATOR . $asset-&gt;getPath();
....
        unlink($assetFilePath);
        copy($tempPath . DIRECTORY_SEPARATOR . $asset-&gt;filename, $assetFilePath);
        unlink($tempPath . DIRECTORY_SEPARATOR . $asset-&gt;filename);

...
$newFileName = 'bla.pdf';
$rename = Craft::$app-&gt;assets-&gt;moveAsset($asset,$asset-&gt;getFolder(),$newFileName);

bla.pdf becomes bla_2021-03-26-124307.pdf but I'll want just 'bla.pdf'.
Try using replaceAssetFile(), something like this (untested):
$rename = Craft::$app-&gt;assets-&gt;replaceAssetFile($asset-&gt;id,$asset-&gt;getFolder(),$newFileName);