NestJS Multer File Upload and Type Validation

Sdílet
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...

Komentáře • 20

  • @abolfazljalildoost766
    @abolfazljalildoost766 Před rokem +1

    Thank you for these amazing tutorials

    • @JonPeppinck
      @JonPeppinck  Před rokem

      Thanks so much! Glad they were helpful.

  • @webhopers3106
    @webhopers3106 Před 4 měsíci

    Thank you so much very helpful

  • @ElyesBoudhina
    @ElyesBoudhina Před měsícem

    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.

  • @imigi427
    @imigi427 Před rokem +1

    Thanks for this tutorial. Good work

  • @authenticatorpark4246
    @authenticatorpark4246 Před rokem +1

    Thx sir

  • @somebody-17546
    @somebody-17546 Před 3 měsíci +1

    Thanks for this course. Can you suggest any good sql courses on udemy?

    • @JonPeppinck
      @JonPeppinck  Před 3 měsíci

      Thank you for checking it out! Sure, check out: tinyurl.com/4hszev2s

  • @omarghanim4859
    @omarghanim4859 Před 2 lety +1

    Fantastic!
    can we implement this with graphql ?

    • @JonPeppinck
      @JonPeppinck  Před 2 lety

      Thanks Omar. Should be able to with some minor tweaks.

  • @fernandomartinez4304
    @fernandomartinez4304 Před rokem

    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

    • @JonPeppinck
      @JonPeppinck  Před rokem +1

      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.

    • @salahadindinsafa7657
      @salahadindinsafa7657 Před rokem

      @@JonPeppinck downgrade the file-type package to 16.5.4

    • @TheVegasISrael
      @TheVegasISrael Před rokem

      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.

    • @triwulandari7341
      @triwulandari7341 Před rokem

      so, you can try 'import * as FileType from 'file-type';

    • @simonaerts2926
      @simonaerts2926 Před rokem

      Does anyone have found a solution? I've tried everything I've seen on internet but nothing works...

  • @vudinhcong
    @vudinhcong Před 2 lety

    Hi bro, How to public image as static server nestjs ?

  • @yayapanthong9334
    @yayapanthong9334 Před 2 lety

    Look good