Skip to content

Commit fbabe0e

Browse files
committed
fix: copy filesystem upload buffer instead of moving
1 parent 1c4fc9b commit fbabe0e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/storage/drivers/filesystem.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export const filesystemDriver = defineStorageDriver({
5454
},
5555

5656
async completeMultipartUpload({ uploadId, objectName }) {
57-
await fs.rename(getUploadBufferPath(uploadId), getStoragePath(objectName))
57+
const bufferPath = getUploadBufferPath(uploadId)
58+
await fs.copyFile(bufferPath, getStoragePath(objectName))
59+
await fs.rm(bufferPath)
5860
},
5961

6062
async abortMultipartUpload({ uploadId }): Promise<void> {

0 commit comments

Comments
 (0)