Nest: File uploading with fastify adapter doesn't work

Created on 26 Jun 2018  路  7Comments  路  Source: nestjs/nest

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

type

Most helpful comment

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

All 7 comments

Duplicate of #719

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

There is a fastify-file-upload

@kolbma the fastify-file-upload package ends up with the same error. @CarterLi how did you solved your issue ?

@kolbma the fastify-file-upload package ends up with the same error. @CarterLi how did you solved your issue ?

I gave up

@FlawaCLV "fastify-multer" and "fastify-multipart" both work just fine with NestJS. Follow the instructions by @Luby1917 to get it working.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rafal-rudnicki picture rafal-rudnicki  路  3Comments

thohoh picture thohoh  路  3Comments

menme95 picture menme95  路  3Comments

tronginc picture tronginc  路  3Comments

hackboy picture hackboy  路  3Comments