How to upload file in backend | Multer

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • Visit chaicode.com for all related materials, community help, source code etc.
    In this video we will learn to upload file using multer and cloudinary
    Code files:
    github.com/hit...
    Sara code yaha milta h
    github.com/hit...
    WhatsApp pe yaha paaye jaate h:
    hitesh.ai/what...
    Discord pe yaha paaye jaate h:
    hitesh.ai/discord
    Instagram pe yaha paaye jaate h:
    / hiteshchoudharyofficial

Комментарии • 940

  • @SarveshKumar-08
    @SarveshKumar-08 10 месяцев назад +60

    00:03 File upload is mainly handled by the back end engineers
    01:52 The method for uploading files in the backend depends on project size, calculations, and file handling.
    05:55 Multer is a commonly used package for file uploading in the industry.
    07:42 Spelling mistake in the stack was corrected and minor bug fixed
    11:35 Upload files to the server using Cloudinary
    13:17 Uploading and managing files in backend using Multer
    17:05 Upload a file in backend using Multer
    19:05 Upload a local file in backend using Multer
    22:33 Upload a file in the backend and print a success message
    24:29 The 'unlink' function is used to remove locally saved temporary files in case of failed upload operations
    27:47 Multer is a middleware used for file uploading in the backend.
    29:32 You can choose between disk storage and memory storage for uploading files in the backend using Multer.
    32:47 Naming the file with a unique ID
    34:26 Configuring the file upload using Multer
    37:50 Learn how to upload files in the backend using Multer.

  • @सरकारीपापा
    @सरकारीपापा 10 месяцев назад +49

    दिपावली का राम राम🙏🙏🙏

  • @khwabvachhani2100
    @khwabvachhani2100 Месяц назад +1

    Hats off to this man.... Gotta say the best web dev teacher out here in youtube

  • @MILINDNEWTON
    @MILINDNEWTON 8 месяцев назад +3

    One of the best explanatory videos I've ever watched.

  • @soumyadipghosh6563
    @soumyadipghosh6563 10 месяцев назад +2

    I've recently joined a start up as a freshers, I've to work mostly on react
    You're nothing less than a God for me sir ❤❤❤❤❤❤❤❤

  • @music11953
    @music11953 10 месяцев назад +3

    Kya baat hai sir ab toh roz hi kuch sikhne ko mil rha hai❤

  • @souvikbid1123
    @souvikbid1123 Месяц назад

    Well diwali to nahi, but parsu teacher's day hai,,
    So, aap jaise teacher ke liye ek banta hi hai sir-
    Very happy teacher's day sir ❤❤❤❤❤

  • @prabhatchandela3959
    @prabhatchandela3959 6 месяцев назад +6

    Attandance March 14 .....wese Holi aane waali hai too Holi ki ram ram 🙏🏼😁

  • @SNEHASINGH-fr4vo
    @SNEHASINGH-fr4vo 6 месяцев назад +1

    File handling done 💯 Thank you sir

  • @developer.sam99
    @developer.sam99 10 месяцев назад +11

    never got such an interesting stuff on internet. Your efforts, work, knowledge is truly appreciable.

    • @chaiaurcode
      @chaiaurcode  10 месяцев назад +10

      Glad you enjoyed it!😃🙏

  • @kumarutkarshuk_
    @kumarutkarshuk_ 8 месяцев назад

    One of the best explanatory videos I've ever watched.

  • @sushantrasaili7173
    @sushantrasaili7173 8 месяцев назад +9

    I should have found this channel earlier.
    Hitesh sir teaches everything very deeply so that students can understand easily.
    And he is teaching the production code, for me this is the best RUclips channel and this channel will get you a job.
    ❤❤❤

  • @aggsha7580
    @aggsha7580 20 дней назад

    Thanks A Lot Sir for such Valuable Content ❤❤

  • @aditya_kanu
    @aditya_kanu 10 месяцев назад +6

    wondering why don't we need async in file storage? that should be quite a lengthy task
    Happy Diwali Sir and Everyone here in the comments

    • @practiceTech
      @practiceTech 10 месяцев назад +1

      Happy Diwali Brother

    • @aditya_kanu
      @aditya_kanu 10 месяцев назад

      @@practiceTech 🪔

  • @tatariyaakhtar504
    @tatariyaakhtar504 7 месяцев назад

    Your learning style is different from everyone else's

  • @mohammadhanif3016
    @mohammadhanif3016 8 месяцев назад +54

    sach mai sir...kahi par bhi search kar lo par aisi series kahi nahi milegi...thankyou sir

  • @codebyprince4562
    @codebyprince4562 8 месяцев назад

    I haven't watched before these types lectures thanks a lots Hitesh sir for providing theses beneficiary lectures.. !

  • @krishviradiya6710
    @krishviradiya6710 10 месяцев назад +3

    Shubh deepawali sirr ji 🎉❤

  • @Omarfaruk-wq5hl
    @Omarfaruk-wq5hl 6 месяцев назад

    Thank you so much sir for explaining the topic very easily

  • @vedparmar319
    @vedparmar319 10 месяцев назад +2

    Really nice video can you please create a tutorial on how to use cache memory in controllers in this series
    i will be grateful for that
    Thank you for the teaching Tutorials are really explainatory

  • @amitkumarsatapathy
    @amitkumarsatapathy 10 месяцев назад +1

    Being a teacher like you is next to impossible.......Your humbleness and the way you make our concept clear is just awesome.....🫡🫡

  • @AbdulRehman-zo4tn
    @AbdulRehman-zo4tn 10 месяцев назад

    sir kindly Tailwind css par bhi complete playlist bannaye woh bohat ziada helpfull rahaay gee for react projects you are truly a gem in coding community sir lots of love from pakistan

  • @Abdullah-0119
    @Abdullah-0119 9 месяцев назад +22

    Haven't seen any teacher explaining this much significance of each small topic. Lots of love sir. Hope you will complete this series. ♥

    • @marvelabhi5586
      @marvelabhi5586 6 месяцев назад

      abdul on mission 💣

    • @_Anshukumar
      @_Anshukumar 6 месяцев назад

      @@marvelabhi5586 lekin sir to backend padha rahe 😶‍🌫

  • @allyn3015
    @allyn3015 8 месяцев назад

    Another day...another tutorial...and one more step towards professionalism. Thank you sir for amazing tutorial. HOPE TO MEET YOU SOON❤

  • @MuhammadYasir-cl4jp
    @MuhammadYasir-cl4jp 10 месяцев назад +3

    Thank you so much sir for explaining the topic very easily and going in depth in every topic. You are truly a gem❤❤❤

  • @ojasmaywade3757
    @ojasmaywade3757 7 месяцев назад

    I thnk god, that i found this channel and this series.😌

  • @RohitSahu-em5il
    @RohitSahu-em5il 9 месяцев назад

    Watching this video on new year so Sir ko New Year ki Ram Ram

  • @yogi1vsall26
    @yogi1vsall26 6 месяцев назад

    watching this video while holi is about to come , happy holi in advance sir ❤❤

  • @shashiKPD
    @shashiKPD 2 месяца назад

    thank you for these high quality videos

  • @priyanshsharma8411
    @priyanshsharma8411 10 месяцев назад

    Thanks for the consistent amazing content. दिवाली की राम राम 🙏🙏

  • @sarkar4670
    @sarkar4670 10 месяцев назад

    Happy diwali....................... Thanks Sir💝

    • @chaiaurcode
      @chaiaurcode  10 месяцев назад +1

      So nice of you.. and happy diwali 🪔

  • @ManishM-b7i
    @ManishM-b7i 10 месяцев назад

    watching this video after diwali , but happy diwali sir.

  • @muhammadammaratique3748
    @muhammadammaratique3748 2 месяца назад

    25:00 We don't need to remove the locally saved temporary file if the upload fails, as keeping the file can be useful for retrying the upload. Only delete the local file after a successful upload.

  • @bunnytheweebster
    @bunnytheweebster 7 месяцев назад

    confident feel kar rha hu abhi se ❤❤

  • @Steve_Chandan
    @Steve_Chandan 10 месяцев назад

    This is going to be epic. Happy diwali Sir in advance.

  • @H_NileshKumar
    @H_NileshKumar 6 месяцев назад

    Happy Holi Sir and all

  • @gajdharsaif9521
    @gajdharsaif9521 4 месяца назад

    #chaiaurcode best backend series

  • @mohmmadashrafzphs405
    @mohmmadashrafzphs405 4 месяца назад

    congrats for 300k subscribers.

  • @krishpatel9248
    @krishpatel9248 5 месяцев назад

    My configuration was done in ram navmi nice 😁

  • @RohitRai-h5i
    @RohitRai-h5i 10 месяцев назад

    Happy Diwali Sir Ji Is diwali ek Chai aapke Nam se

  • @nirajsali6939
    @nirajsali6939 10 месяцев назад

    Thanks Sir, and Happy Dipawali

  • @KidsWonderland99
    @KidsWonderland99 5 месяцев назад

    make a video on fullstack interview questions and interview practicals. plz

  • @dnyanesh4589
    @dnyanesh4589 10 месяцев назад

    Getting regular benefits from this series. Thanks for the simple explanations.

  • @prateekkumar3729
    @prateekkumar3729 10 месяцев назад

    Happy Diwali Bhaiya💕💕

  • @Odiabadsha
    @Odiabadsha 10 месяцев назад +1

    Hi Hitesh Sir, is blockchain development a good career choice ? what's your suggestion.

  • @harshbansal4602
    @harshbansal4602 10 месяцев назад +1

    Ram Ram sir ji 🙏🚩❤

  • @hirdeshrajputt
    @hirdeshrajputt 29 дней назад

    Happy teachers day 🎉😀😀😀😀 37:41 sir jii

  • @PankajSingh-pb4vs
    @PankajSingh-pb4vs 2 месяца назад

    Amazing Series

  • @CryptowithPuneeT
    @CryptowithPuneeT 10 месяцев назад

    happy diwali and ram ram sir jii😊😊😊😊😊😊

  • @sinha.aditya
    @sinha.aditya Месяц назад

    Maja aagya Sir Ji 💗

  • @dipalibohara5679
    @dipalibohara5679 4 месяца назад

    sir if it is possible then make a video on how to use redis in an application

  • @RealEstateandTechnology
    @RealEstateandTechnology 10 месяцев назад +1

    sir comment o gya .. thanks for this video ..

  • @Evil_E_ye
    @Evil_E_ye 10 месяцев назад

    High quality content indeed, when i started my journey 2 years ago, i was not able to find this type of quality content and learned the hard way. For people who do not have time to study everything via docs, these tutorials are diamond and really really good, i wish i had got this much content when i was learning all these stuffs, but it is still the best feeling when you do stuff yourself without any tut, everyone should try learning themselves first before watching any tutorial (imo).
    Please keep up this good work, its highly appreciated ❤.
    (Happy diwali ❤) i hope everyone can achieve success in their life and hitesh sir a long lifespan ❤.

  • @kushagrakatiha
    @kushagrakatiha 10 месяцев назад

    ram ram sir...........happy diwali

  • @yashpandey350
    @yashpandey350 9 месяцев назад +2

    Happy Diwali Sir, Sorry for late wish but I always prefer watching any playlist once it gets completed so that I don't need to wait for upcoming videos😅😅❣❣

  • @codingssprint7362
    @codingssprint7362 8 месяцев назад +1

    nice explain

  • @mr.Rockygamer
    @mr.Rockygamer 10 месяцев назад

    happy diwali bhai ....

  • @roydisha7714
    @roydisha7714 10 месяцев назад

    Happy Diwali Sir 💖💖

  • @krishnnarayan6239
    @krishnnarayan6239 9 месяцев назад

    #ChaiAurCode , Thankyou sir for providing this quality content..

  • @jayrai18
    @jayrai18 10 месяцев назад

    great level of teching sirji

  • @User-v9i7l
    @User-v9i7l 4 месяца назад +1

    Ram Ram Guruji

  • @Khedhar108
    @Khedhar108 10 месяцев назад

    storing files - aws , third party like cloudinary, multer or express-file upload
    how to handle file upload : seperate utility function or using middleware not using in controllers
    same code for img, video, pdf
    Cloudinary : "4:33" "8:42"
    files from user ---multer--> localStorage-->Cloudinary "10:38" 2 steps setting why?
    file system (fs) in node: "14:20" -open , read ,
    unlink : "15:15" & "24:22"
    cloudinary : "18:20"
    multer as middleware for specific routes : "27:50"
    multer.diskstorage(destinatioin, filename)
    function (req,file,cb){cb(null, //write your logic)}
    destination: function (req,file,cb){cb(null,"./public/location")}
    filename:function (req,file,cb){cb(null,file.originalname// use date for unique)}

  • @omshinde3614
    @omshinde3614 10 месяцев назад

    Happy Diwali sirrr

  • @RohitKumar-ku2lq
    @RohitKumar-ku2lq 10 месяцев назад

    Thank you sir for this amazing series. I understand what being in the zone means. And these `charcha` takes us to that zone of learning. Amazing series. Keep it up!!! Happy Diwali everyone

  • @Dev-Phantom
    @Dev-Phantom 6 месяцев назад +1

    The best video

  • @sugarfreecode
    @sugarfreecode 10 месяцев назад +2

    32:20 The file path here is './public/temp'... I guess it will store the file in the current directory, that is "middleware" folder.
    Shouldn't we write '/public/temp' ?

  • @Dev-Phantom
    @Dev-Phantom 6 месяцев назад +1

    Ram Ram sir ji

  • @TanushSahu-r8m
    @TanushSahu-r8m 9 дней назад

    diwali ki ram ram sir ji

  • @deepanshusaini4714
    @deepanshusaini4714 8 месяцев назад +1

    🤍Dil garden garden ho gya sir se backend Phadkar ! 🤍

  • @kenil98
    @kenil98 9 месяцев назад

    Awesome Content ❤❤❤

  • @wasit-shafi
    @wasit-shafi 7 месяцев назад

    Very Informative video, I am just having one doubt incase we have uploaded media files/images directly to cloud eg AWS S3 (post validating on frontend instead of doing it on backend) then we can save a lot of bandwidth/time/cost assuming we have lot of users on website and they can also upload images of good quality eg 5MB average size. In case someone can add related usecases will be better to know. Thanks

  • @aadilkhannew
    @aadilkhannew 10 месяцев назад

    Happy Diwali Sir 🎉 🪔🪔🎇🎇🎇🎇

  • @luxurycars-kk3ro
    @luxurycars-kk3ro 6 месяцев назад

    Haapy holi sir for advance

  • @akashbhardwaj3214
    @akashbhardwaj3214 10 месяцев назад

    Happy Diwali sir🎉

  • @duckworthlewisinfo
    @duckworthlewisinfo 10 месяцев назад

    Happy Diwali sir ji🪔🪔🪔🪔🪔🪔🪔

  • @mahakaalgaming25
    @mahakaalgaming25 10 месяцев назад

    Happy deepawali sir

  • @memehub-nr7xx
    @memehub-nr7xx 10 месяцев назад

    दिवाली की हार्दिक हार्दिक शुभकामनाय सर आप भी ज्ञान का दीपक हमारे लिए जलाये राखीयेगा 💗

  • @surajgusain3656
    @surajgusain3656 8 месяцев назад +1

    24:53 we unlink the file in catch block....but if the file is not uploaded in the cloudinary then why we are removing it from the temp folder... instead shouldnt we delete the file when the upload is done ?

  • @mutecoding
    @mutecoding 10 месяцев назад

    Happy Diwali 🎉🎉 sir

  • @enc21lakshaybhatia23
    @enc21lakshaybhatia23 2 месяца назад +1

    thankyou sir

  • @Aniket_0314
    @Aniket_0314 10 месяцев назад

    diwali ki ram ram ❤ late hai but ram ram toh jb karo tbhi achha hai

  • @vishalss20fe5g3
    @vishalss20fe5g3 8 месяцев назад +1

    why was `fs.unlinkSync()` used instead of `fs.unlink()`? Wouldn't it be better to use an asynchronous( `unlink()` ) function to delete a file so that it would not block the event loop on the server?

  • @sumantagorai5880
    @sumantagorai5880 10 месяцев назад

    Happy Diwali, Sir❤.

  • @rnabyankitavasthi
    @rnabyankitavasthi 10 месяцев назад

    Happy Diwali Sir Ji

  • @asmittyagi6250
    @asmittyagi6250 6 месяцев назад +2

    Back to backend again. This time not going anywhere until I complete this.

  • @believer_rajdevyadav
    @believer_rajdevyadav 8 месяцев назад

    thanks a lot sir ji, hnji apko hi 😁😍

  • @adityasinghchouhan3670
    @adityasinghchouhan3670 8 месяцев назад

    Great lecture

    • @chaiaurcode
      @chaiaurcode  8 месяцев назад +1

      Glad you think so!☕️😊

  • @Coding-z1m
    @Coding-z1m 7 месяцев назад

    Diwali ka Ram Ram bhaiya

  • @SurajGupta-ux2se
    @SurajGupta-ux2se 10 месяцев назад

    Happy Diwali Sir

  • @ugyenofficial
    @ugyenofficial 10 месяцев назад

    nice lesson sir. thank you so much

  • @harshprakashofficialhpmv3237
    @harshprakashofficialhpmv3237 10 месяцев назад

    Happy Diwali Sir

  • @munna5553
    @munna5553 10 месяцев назад

    Happy diwali sir😊😊😊😊😊😊😊

  • @patelaryan0914
    @patelaryan0914 10 месяцев назад

    HAPPY DIWALI SIR!!!

  • @naveengupta157
    @naveengupta157 10 месяцев назад

    Happy diwali Sir

  • @mdjamilakhtar9052
    @mdjamilakhtar9052 10 месяцев назад

    Happy Diwali sir

  • @coderaditya5378
    @coderaditya5378 10 месяцев назад

    Happy Diwali sir

  • @mashaltechs
    @mashaltechs 10 месяцев назад

    LOVE FROM PAKISTAN SIR 😇😇

  • @abhayyraz
    @abhayyraz 6 месяцев назад

    happy diwali sir

  • @adityapanday9917
    @adityapanday9917 17 дней назад

    Guru ji Ram Ram ❤

  • @-a-1787
    @-a-1787 10 месяцев назад +2

    Diwali ki ram ram