import { Module } from '@nestjs/common' ; import * as path from 'path' ; import { UploadController } from './upload.controller' ; import { UploadService } from './upload.service' ; import { MulterModule } from '@nestjs/platform-express' ; import { diskStorage } from 'multer' ; @ Module ( { imports : [ MulterModule . register ( { storage : diskStorage ( { destination : path . join ( __dirname , '../../upload_dist' ) , filename ( req , file , cb ) { cb ( null , file . originalname ) ; } , } ) , } ) , ] , controllers : [ UploadController ] , providers : [ UploadService ] , } ) export class UploadModule { }