We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bca60a commit d69d495Copy full SHA for d69d495
server/src/common/disk/fileUtils.ts
@@ -2,7 +2,7 @@ import { join } from 'path';
2
import { ensureDirSync } from 'fs-extra';
3
import { promises as fs } from 'fs';
4
import { existsSync } from 'fs';
5
-import { v4 as uuidv4 } from 'uuid';
+import * as uuid from 'uuid';
6
import { BadRequestException } from '@nestjs/common';
7
import { FileUploadType } from './fileValidator';
8
@@ -16,7 +16,7 @@ export const generateFilePath = (originalPath: string): string => {
16
17
export const getFileName = (file: any): string => {
18
const ext = file.originalname.split('.').pop()?.toLowerCase() || '';
19
- return `${uuidv4()}.${ext}`;
+ return `${uuid.v4()}.${ext}`;
20
};
21
22
export const createDirectoryIfNotExists = (uploadType: string): string => {
0 commit comments