mirror of
https://github.com/cheveguerra/Whaticket.git
synced 2026-04-19 12:09:14 +00:00
Initial commit
This commit is contained in:
16
backend/src/config/upload.ts
Normal file
16
backend/src/config/upload.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import path from "path";
|
||||
import multer from "multer";
|
||||
|
||||
const publicFolder = path.resolve(__dirname, "..", "..", "public");
|
||||
export default {
|
||||
directory: publicFolder,
|
||||
|
||||
storage: multer.diskStorage({
|
||||
destination: publicFolder,
|
||||
filename(req, file, cb) {
|
||||
const fileName = new Date().getTime() + path.extname(file.originalname);
|
||||
|
||||
return cb(null, fileName);
|
||||
}
|
||||
})
|
||||
};
|
||||
Reference in New Issue
Block a user