Skip to content

Commit 3b734b8

Browse files
committed
fix(backend:files): avoid copy failures when sample documents are read-only and files are written to a CIFS share by falling back to stream copy
1 parent fa2d601 commit 3b734b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/src/applications/files/services/files-manager.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { FileError } from '../models/file-error'
3535
import { LockConflict } from '../models/file-lock-error'
3636
import {
3737
checkFileName,
38+
copyFileContent,
3839
copyFiles,
3940
createEmptyFile,
4041
dirName,
@@ -244,7 +245,7 @@ export class FilesManager {
244245
const fileExtension = path.extname(space.realPath)
245246
if (checkDocument && fileExtension !== '.txt' && Object.values(DOCUMENT_TYPE).indexOf(fileExtension) > -1) {
246247
const srcSample = path.join(__dirname, `${SAMPLE_PATH_WITHOUT_EXT}${fileExtension}`)
247-
return copyFiles(srcSample, space.realPath, false, false, false)
248+
return copyFileContent(srcSample, space.realPath)
248249
} else {
249250
return createEmptyFile(space.realPath)
250251
}

0 commit comments

Comments
 (0)