How To Upload Files With Node.js

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 76

  • @antoinebalaine2061
    @antoinebalaine2061 3 роки тому +14

    Excellent tutorial ! After a daunting amount of hours spent pulling my hair on god-forbiddingly-poorly-written example code across the net, this soothing voice & fantastic explanation saved my day. Thank you !

    • @codewithbubb
      @codewithbubb  3 роки тому +1

      Ah, thanks Antoine, appreciate the feedback. Have you got it working now?

    • @antoinebalaine2061
      @antoinebalaine2061 3 роки тому +3

      @@codewithbubb Like a charm !

  • @solykekaren
    @solykekaren 4 роки тому +5

    omg this is the best upload tutorial i have seen. trust me, i have scoured through youtube for a lot of simple examples but i enjoyed the whole video. thanks for making this!

    • @codewithbubb
      @codewithbubb  4 роки тому

      Hey Karen, oh so glad you liked it! Yes, I like to make everything as short and simple as possible 😀

  • @takdanaicheepsaritdipong9381
    @takdanaicheepsaritdipong9381 3 роки тому

    I have a job interview next week and I need to finish my project. This saves my life

  • @Raheem-ry3ze
    @Raheem-ry3ze 2 роки тому +1

    I can't thank you enough
    This really helped me with my project
    For some reason i haven't seen anyone in udemy explaining how to upload files with node JS ,and the other youtube videos don't explain it well but this turtorial really helped
    Thanks a lot

    • @codewithbubb
      @codewithbubb  2 роки тому +1

      Ah, that's really good to hear! Yeah, it's kinda one of those things that big tutorials seem to skip over.

  • @kamranshahid8825
    @kamranshahid8825 3 роки тому +1

    Thank you one! one of best tutorial on youtube I have ever watched. Clear and to the point.

    • @codewithbubb
      @codewithbubb  3 роки тому

      Thanks so much Kamran! Appreciate your support 👍

  • @rak3611
    @rak3611 3 роки тому +1

    Sir Thank you very much, you are really the best! I have watched a 2 hours Tutorial about uploading files and then send them via Email without any success. But here in your Video after 10 Minutes I have got the way how to do it! I really appreciate that and want to Thank you a lot sir!

    • @codewithbubb
      @codewithbubb  3 роки тому

      You're welcome! Glad you found it useful 😀

  • @xavierd4166
    @xavierd4166 Рік тому

    @3:58 when file is chosen and submit button clicked, i do not see "cannot post/upload" - instead see page cannot be found.. why so?

  • @ohad7
    @ohad7 3 роки тому

    best upload tutorial i have seen !
    very helpful, You explain excellent and clear.
    Thanks for sharing

  • @gokulbhoi4057
    @gokulbhoi4057 2 роки тому +1

    Helpful at the right moment!! Thank You Sir!

  • @thegamedevclub
    @thegamedevclub 3 роки тому +1

    hey how does this work with BlackBlaze?

  • @garikmelqonyan9130
    @garikmelqonyan9130 3 роки тому +1

    Thanks man.Just what I was looking for!

    • @codewithbubb
      @codewithbubb  3 роки тому

      Great! Hope you found it useful 😀

  • @baxtables
    @baxtables 2 роки тому

    at 2:43 , how did the index.html render onto the screen without writing a app.get("/") method

    • @shlomoh.6148
      @shlomoh.6148 2 роки тому

      Probably due to older node/express version.
      need to replace with
      app.use(express.static(path.join(__dirname, "public")));
      and import:
      const path = require('path')

  • @RianY2K
    @RianY2K 4 роки тому +5

    Thank you for tutorial in uploading files on Node Express

    • @codewithbubb
      @codewithbubb  4 роки тому

      You're welcome, hope you found it useful.

  • @BillTheChill654
    @BillTheChill654 2 роки тому

    Question: is there a way to prevent the page from reloading when you submit the form?

  • @zhongtom2625
    @zhongtom2625 2 роки тому +1

    thanks for the video. thit is a practical solution for file upload to s3 as we can use our server for authentication. However I have a question, does the file actually uploads to our server and then from our server to s3, or does it go directly from client to s3? I am asking because the former setup in fact doubles the traffic of our server. thanks.

    • @codewithbubb
      @codewithbubb  2 роки тому

      If you're using S3 then the file is first temporarily uploaded to the server (held in tmp or wherever your server / backend has this setup) and then this is transferred to S3 with your Node / backend code. It does not go directly from the client as your code to publish to S3 is running on your server!
      I'm not sure about the doubling of traffic however - you've got data coming in (the file upload) and data going out (the transfer to S3). Depending on where you're hosting this, it shouldn't be a problem and is quite normal.

  • @JC-fd8ho
    @JC-fd8ho 2 роки тому

    i was wondering can't u just use vanilla node js without all these packages to upload and why is it so cumbersome in node to upload a file can't u use upload a file like we would in regualr js and send to a server ?

  • @user-ik2yt7ig9f
    @user-ik2yt7ig9f 3 роки тому

    How to add multiple upload field in single form for example photo, ID proof with API connection.

  • @jhonlee788
    @jhonlee788 2 роки тому +1

    Hello, i hosted my app in Cpanel with multer + nodesJS, but multer is not working, i'm not getting my images saved in the folder "images" of the File System, any help please ?
    Thanks in advance !

    • @codewithbubb
      @codewithbubb  2 роки тому

      Does your hosting support node.js backends? What happens when you upload a file?

    • @jhonlee788
      @jhonlee788 2 роки тому

      @@codewithbubb Yep !
      The probleme is that my hosting doesn't allow me to store files in my backend so :')

  • @patrickmayer4737
    @patrickmayer4737 3 роки тому +1

    Junior Developer Central - any idea as to how i can fix this error? Happens right after I submit image to s3
    CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
    at Timeout.connectTimeout [as _onTimeout]

    • @codewithbubb
      @codewithbubb  3 роки тому

      Hi Patrick, how are you providing your AWS Credentials?

    • @patrickmayer4737
      @patrickmayer4737 3 роки тому

      @@codewithbubb I added everything the same way you added them

    • @patrickmayer4737
      @patrickmayer4737 3 роки тому

      @@codewithbubb Now getting the error "Error: connect EHOSTUNREACH"

    • @Marky00
      @Marky00 2 роки тому

      @@patrickmayer4737 did you find a soultion. have the same problem

    • @vladspace6918
      @vladspace6918 2 роки тому

      Did you solve this problem?

  • @cristianmorris8674
    @cristianmorris8674 4 роки тому

    It is an amazing explanation. It help me a lot with my project: Multipart retrofit android app and Nodejs.
    Thanks!!

  • @captaincat8550
    @captaincat8550 3 роки тому

    I cant add .env file anymore pls fix of or help mee

  • @serhadaras4461
    @serhadaras4461 3 роки тому

    Hey, thanks for the tutorial. I tried to follow your steps but it won't upload to my local machine nor to my ec2 or s3 aws services. Do you know the most common issues? Thanks in advance

  • @davidlo2247
    @davidlo2247 4 роки тому +1

    Hi, is it possible to upload multiple files in multiple fields such that each field can only upload one file and the order of the files to be uploaded matters (such as the first file is English and the other is the translated language)?

    • @codewithbubb
      @codewithbubb  4 роки тому

      Hi David, this should be possible but it might require a little bit of structuring of the front-end application that the user is uploading through. Were you looking to upload the files at the same time?

  • @zAcceleration
    @zAcceleration 3 роки тому +1

    You are very good at explaining. Thank you so much

  • @slowqueso7488
    @slowqueso7488 3 роки тому +2

    please a make video about sending files from server to client to a download button

    • @codewithbubb
      @codewithbubb  3 роки тому

      Do you mean, uploading a file and then put it on a page to download?

    • @derarageremu
      @derarageremu 2 місяці тому

      @@codewithbubb yes

  • @libertad83y
    @libertad83y 4 роки тому +2

    Very good topic, very interesting, Thanks!

  • @rolandojr.4044
    @rolandojr.4044 4 роки тому

    How do I reference the image if I'm going to use onSubmit instead of the action="/upload" ?

  • @bryanprimus
    @bryanprimus 4 роки тому +1

    how to save the path to database and serve the image by the path ?

    • @codewithbubb
      @codewithbubb  4 роки тому

      Hey Bryan, see here: ua-cam.com/video/oeMokkPaL6Y/v-deo.html

  • @stefanfeldner
    @stefanfeldner 3 роки тому

    Is there any way to upload whole folders with other folders inside? I can't find a way to do that, is that even possible?

  • @jamisco4432
    @jamisco4432 3 роки тому +1

    Great stuff, this really helped me

    • @codewithbubb
      @codewithbubb  3 роки тому +1

      Cool! Glad it helped you out 😀

    • @jamisco4432
      @jamisco4432 3 роки тому

      @@codewithbubb What are your thoughts on Deploying Node with Azure?
      Have you done it? Would you recommend it?

  • @javadmh7827
    @javadmh7827 2 роки тому

    You saved me bro, Thank you.

  • @codewithbubb
    @codewithbubb  4 роки тому +2

    Check out part 2 to see how to save the file paths to a database: ua-cam.com/video/oeMokkPaL6Y/v-deo.html

  • @bryanprimus
    @bryanprimus 4 роки тому +1

    how to set access key manually from the code?

    • @codewithbubb
      @codewithbubb  4 роки тому

      I think you pass it to the constructor of AWS.credentials() (see docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html#constructor-property) but please don't leave them in your code!

    • @bryanprimus
      @bryanprimus 4 роки тому +1

      @@codewithbubb yeah i'll made it on .env file. thankyou

    • @codewithbubb
      @codewithbubb  4 роки тому

      @@bryanprimus No problem.

  • @jivanmainali1742
    @jivanmainali1742 3 роки тому +1

    but its not working for big file size

  • @ercancelen8
    @ercancelen8 4 роки тому +1

    Thanks, was really helpful.

  • @dhriti1987
    @dhriti1987 3 роки тому

    I wish I could like it one more time then you would have 300 likes.

  • @thanseehaalik6562
    @thanseehaalik6562 4 роки тому

    CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
    at Timeout.connectTimeout [as _onTimeout]
    how can i solve this problem

    • @patrickmayer4737
      @patrickmayer4737 3 роки тому

      Did you figure out a solution to this problem? Getting the same thing

  • @andresgutgon
    @andresgutgon 2 роки тому

    Awesome thanks!

  • @MA-ct1qw
    @MA-ct1qw 2 роки тому

    Yall obsessed with the form tag. Try a tutorial with an input type file WITHOUT form tag sometime. The problem with this is that the page refreshes. I used that 20 years ago.

  • @jasonh5405
    @jasonh5405 2 роки тому +1

    thanks!

    • @codewithbubb
      @codewithbubb  2 роки тому

      You’re welcome, hope you found it useful!

  • @thefoxguy
    @thefoxguy 3 роки тому +1

    Own cloud app go brrrrrrrrrr