NestJS Multer File Upload and Type Validation
Vložit
- čas přidán 16. 06. 2021
- In this video we use NestJS with file-type and Multer to create the ability to upload and retrieve files from a server. This video filters out unwanted files and also removes attempts to store files of a valid extension type but are not of the actual type. e.g. renaming a .txt file to .png for image upload.
--------------------------------------------------
Recommended Udemy courses
--------------------------------------------------
NestJS - Zero to Hero: tinyurl.com/3rxsz669
Angular - The Complete Guide: tinyurl.com/4h5rmpsj
Understanding TypeScript: tinyurl.com/9wz6fp7k
React - The Complete Guide: tinyurl.com/2t6v5yeu
Docker Mastery (with Kubernetes + Swarm): tinyurl.com/yeymdnhn
Playlist: • LinkedIn Clone - Ionic...
GitHub: github.com/Jon-Peppinck/linke...
Thank you for these amazing tutorials
Thanks so much! Glad they were helpful.
Thank you so much very helpful
Hello Jon, why do you upload file then check for validation and then delete it if does not pass them, why not filter it from the start and avoid uploading it and deleting afterwards if it fails the validations.
Thanks for this tutorial. Good work
Thanks so much
Thx sir
No worries, thanks for watching!
Thanks for this course. Can you suggest any good sql courses on udemy?
Thank you for checking it out! Sure, check out: tinyurl.com/4hszev2s
Fantastic!
can we implement this with graphql ?
Thanks Omar. Should be able to with some minor tweaks.
HiJon, thanks for the content. I have a problema with the require file-type. Error [ERR_REQUIRE_ESM]: require() of ES Module. Have u any idea how to solve it? Thanks
Thanks! All good. I am not sure. I would check the documentation to see if there has been an update to the way it is consumed.
@@JonPeppinck downgrade the file-type package to 16.5.4
Solution with downgrade not looks so good.
I believe many people using newer versions (18 for today).
It' must have some solution, but I did't found yet.
In documentation say's that we can use import instead of require (actually no word about require), but the error still persist.
so, you can try 'import * as FileType from 'file-type';
Does anyone have found a solution? I've tried everything I've seen on internet but nothing works...
Hi bro, How to public image as static server nestjs ?
Look good