Skip to content

Commit bf1ebd1

Browse files
committed
fix: remove existing destination file before moving ing GridFS
1 parent fefad34 commit bf1ebd1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/GridFS/GridFSAdapter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ public function move(string $source, string $destination, Config $config): void
349349
return;
350350
}
351351

352+
if ($this->fileExists($destination)) {
353+
$this->delete($destination);
354+
}
355+
352356
try {
353357
$result = $this->bucket->getFilesCollection()->updateMany(
354358
['filename' => $this->prefixer->prefixPath($source)],

0 commit comments

Comments
 (0)