File uploading with fastify adapter doesn't work

See original GitHub issue

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

File-uploading with fastify adapter results in Unsupported Media Type: multipart/form-data; boundary=----WebKitFormBoundarybFtFByqN8yn20quJ error.

I have also tried

const adapter = new FastifyAdapter();
adapter.register(require('fastify-multipart'));
await NestFactory.create(AppModule, adapter);

which results in TypeError: req.pipe is not a function

Expected behavior

Works properly

Minimal reproduction of the problem with instructions

await NestFactory.create(AppModule, new FastifyAdapter());

And what is described in https://docs.nestjs.com/techniques/file-upload

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

File uploading should work with FaastifyAdapter

Environment


Nest version: 5.0.1

 
For Tooling issues:
- Node version: v10.5.0  
- Platform: Mac 

Others: N/A

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
CarterLicommented, Jun 27, 2018

The doc ( at least the file-upload page ) says nothing about fastify compatibility. I think it’s better to mention in the doc to make users less confusing @kamilmysliwiec

0reactions
lock[bot]commented, Dec 29, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upload files using multipart with Fastify and NestJS - Medium
First install the multipart package from the repository. Create a new folder “uploads” in your project folder.
Read more >
Nestjs - file upload with fastify multipart - Stack Overflow
I'm using GraphQL, and I've the same issue. Do you know how to make it work with GraphQL? Related issue and small example...
Read more >
How to handle Node.js file uploads with Fastify - Snyk
Set up a file upload plugin​​ To do this, you need to import multipart from '@fastify/multipart' and then register it. Here you registered ......
Read more >
NestJS Upload File with FastifyAdapter - DEV Community ‍ ‍
Today I'm gonna implement a fastify-multer upload image for NestJS using FastifyAdapter(), Look! is it possible? Multer cannot process data ...
Read more >
@webundsoehne/nest-fastify-file-upload - npm
@webundsoehne/nest-fastify-file-upload. TypeScript icon, indicating that this package has built-in type declarations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found