skip to Main Content

Javascript – How to reuse mutler settings to specify a different folder for a route

I initialize MutlerModule to app.module: MulterModule.registerAsync({ imports: [ ConfigModule ], inject: [ ConfigService ], async useFactory(configService: ConfigService) { const uploadFolder = configService.get<IConfig[ "uploadFolder" ]>("uploadFolder"); return { storage: diskStorage({ destination: uploadFolder, filename(req, file, cb) { const filename = `${ Date.now() }-${…

VIEW QUESTION

Reactjs – Issue with multer upload files

I want to upload images on the website built on React. I have issue with backend Node.js code. Code: const multer = require("multer"); // Check if the directory exists, if not, create it const directory = path.join(__dirname, "../src/assets/img/images"); if (!fs.existsSync(directory))…

VIEW QUESTION
Back To Top
Search