v4.6.6-fix (#676)
This commit is contained in:
@@ -3,6 +3,7 @@ import { customAlphabet } from 'nanoid';
|
||||
import multer from 'multer';
|
||||
import path from 'path';
|
||||
import { BucketNameEnum } from '@fastgpt/global/common/file/constants';
|
||||
import fs from 'fs';
|
||||
|
||||
const nanoid = customAlphabet('1234567890abcdef', 12);
|
||||
|
||||
@@ -69,3 +70,13 @@ export function getUploadModel({ maxSize = 500 }: { maxSize?: number }) {
|
||||
|
||||
return new UploadModel();
|
||||
}
|
||||
|
||||
export const removeFilesByPaths = (paths: string[]) => {
|
||||
paths.forEach((path) => {
|
||||
fs.unlink(path, (err) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user