Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Interceptor only supports one options at a time (overrides other options) #429

Closed
mentos1386 opened this issue Feb 17, 2018 · 2 comments

Comments

@mentos1386
Copy link

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

If we have two upload routes in controller, second FileInterceptor destination will override first, so only second destination will be used.

Expected behavior

Each route should store files to own destination.

Minimal reproduction of the problem with instructions

  @Post('/upload/image')
  @UseInterceptors(FileInterceptor('file', { dest: 'images/' }))
  public async uploadImage(
    @Req() req: IRequest,
    @UploadedFile() file: Express.Multer.File,
  ) {
    ...
  }

  @Post('/upload/video')
  @UseInterceptors(FileInterceptor('file', { dest: 'videos/' }))
  public async uploadVideo(
    @Req() req: IRequest,
    @UploadedFile() file: Express.Multer.File,
  ) {
  ...
  }

What is the motivation / use case for changing the behavior?

We should be able to provide different destinations (options) on different routes.

Environment


Nest version: 4.6.0

@mentos1386 mentos1386 changed the title File Interceptor only supports one options at a time (overrides other options). File Interceptor only supports one options at a time (overrides other options) Feb 17, 2018
@kamilmysliwiec kamilmysliwiec self-assigned this Feb 17, 2018
@kamilmysliwiec
Copy link
Member

Fixed in v4.6.4 🙂

@lock
Copy link

lock bot commented Sep 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants