diff --git a/lib/private/Files/Cache/Updater.php b/lib/private/Files/Cache/Updater.php
index b6a0e62a88a774db50e3bb9890bb663fe804d25f..79501d910e502b5d48e63c217071e56777b72475 100644
--- a/lib/private/Files/Cache/Updater.php
+++ b/lib/private/Files/Cache/Updater.php
@@ -201,7 +201,11 @@ class Updater implements IUpdater {
 				$this->cache->moveFromCache($sourceCache, $source, $target);
 			}
 
-			if (pathinfo($source, PATHINFO_EXTENSION) !== pathinfo($target, PATHINFO_EXTENSION) && $sourceInfo->getMimeType() !== FileInfo::MIMETYPE_FOLDER) {
+			$sourceExtension = pathinfo($source, PATHINFO_EXTENSION);
+			$targetExtension = pathinfo($target, PATHINFO_EXTENSION);
+			$targetIsTrash = preg_match("/d\d+/", $targetExtension);
+
+			if ($sourceExtension !== $targetExtension && $sourceInfo->getMimeType() !== FileInfo::MIMETYPE_FOLDER && !$targetIsTrash) {
 				// handle mime type change
 				$mimeType = $this->storage->getMimeType($target);
 				$fileId = $this->cache->getId($target);