Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

319
Views
Upload dynamic multiple files in Nest JS

I'm trying to upload files with dynamic keys, but nest.js needs to know key names.

I tried this one:

 @UseInterceptors(FilesInterceptor('files'))
    async uploadFile(@Query() minioDto: MinioDto, @UploadedFiles() files: Array<BufferedFile>) {
        const {bucket} = minioDto;
        return (await this.minioClientService.upload(files, bucket))?.name;
    }

Here files are static, but I want dynamic like:

@UseInterceptors(FilesInterceptor())
    async uploadFile(@Query() minioDto: MinioDto, @UploadedFiles() files: Array<BufferedFile>) {
        const {bucket} = minioDto;
        return (await this.minioClientService.upload(files, bucket))?.name;
    }

I even tried to get files from the request but I couldn't

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can upload multiple files dynamically using AnyFilesInterceptor provided by nest.js like below:

@Post('upload')
@UseInterceptors(AnyFilesInterceptor())
uploadFile(@UploadedFiles() files: Array<Express.Multer.File>) {
  console.log(files);
}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!