I want to upload a file to fastify server,How could I do?
There are some relative modules:
- fastify-file-upload
- fastify-multipart ...
The difference between the two is how the file is sent to the server. You should select one depending on how large your file is. Multi-part data is divided into chunks and sent to the sever (necessary for large files) while the regular upload will send the file as a single chunk.
Considering that your file size might become large enough to use the multi-part option then you may want to go ahead and implement it.
Both packages have good examples of how to upload a file so you just need to decide which package to use.