No video

Node.js File Upload API with Express Tutorial

  Рет қаралды 66,435

Dave Gray

Dave Gray

Күн бұрын

Пікірлер: 160
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
In this tutorial, you will learn how you can upload all types of files to a Node.js REST API server. We'll create several different reusable middlewares for Node.js & Express and we'll learn how to use one HTML input to upload multiple files at the same time. If you are just getting started with Node.js, I recommend my Node.js for Beginners full course found here: kzfaq.info/get/bejne/nJh1pKh0zrqmfGw.html
@ajaypathak137
@ajaypathak137 Жыл бұрын
Hey Dave, you're teaching is incomparable. could please make a Next js full project with nextauth and mongo db
@bugra2505
@bugra2505 10 ай бұрын
You are my best teacher Gray! Thank's from Turkey :)
@santiagopinerofreitas4592
@santiagopinerofreitas4592 Жыл бұрын
I love the perfection side of your videos, on minute 22:32 you make it clear to all of us. Thank you for bringing this professionalism.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome! I struggle with perfectionism. The reminder at the end of each video is for me as much as everyone else - keep striving for progress (not perfection). A little bit every day :)
@ryant2350
@ryant2350 2 жыл бұрын
I get so excited now when I see you post a new video! Can't wait to watch this one
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Ryan! 💯
@psaintjean11
@psaintjean11 2 ай бұрын
This video is simply amazing!! Especially for a beginner coder with about a week of learning. You are so precise and so thorough in explaining each separate section of coding logic in the building of each file and it’s related files. Simply Amazing 🎉
@pawelsb
@pawelsb Жыл бұрын
Hey Dave, Great Course, I've completed ReactJS and JavaScript playlists too from you. Your explanations are crystal clear and to the point. Thanks for the great quality content Dave. Have a great day.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad you like them and thanks for the kind words! 🙏💯
@mohamedyoussef8835
@mohamedyoussef8835 2 жыл бұрын
You tackle the hardest topics that others evade
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏 You must challenge yourself to grow 💯
@FloorMann
@FloorMann 8 ай бұрын
i usually fail to follow tutorials, this man is genius!
@sudhikrishnana9778
@sudhikrishnana9778 Жыл бұрын
Hey Dave, it would be great if you could make a react frontend form to upload xlsx files (or any other file) like in this video with backend. By the way your react, javascript, node js, css, tailwind courses are top notch, understood all the concepts.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you and thanks for the request!
@mahdisalmanizadegan5595
@mahdisalmanizadegan5595 2 жыл бұрын
Dave your teaching approach is really amazing, you're one of the best teacher i've ever had in my life. thank you for sharing such a valuable contents.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the kind words, Mahdi! 🙏
@raymondmichael4987
@raymondmichael4987 2 жыл бұрын
This glued me to a screen till the last seconds. Thanks Dave. I’ll definitely like to see React at the front end interacting with this api. Also, How to handle uploading such files to a mongodb or cloudnary service? After sometime. Meaning save temporarily to the save then move the files to cloudnary and store image url returned. BTW, thanks, you’re such a blessing to us learners
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Raymond! 🙏 I appreciate the requests!
@richardwilliam7030
@richardwilliam7030 2 жыл бұрын
Im working on a kyc app and i struggled with limiting size of the document upload, now thanks to Dave, ive fixed it.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad to hear that, Richard! 💯
@jvenkatonline
@jvenkatonline Жыл бұрын
Hi Dave, Just now I have completed the video and tried it - its working well. Of course, it took some time for me to understand the concepts. But overall, really interesting - you did not use even axios or any other extras. Especially you have taken additional efforts to show the error messages without any grammatical issues and you have used middleware for validating the files are amazing. You did a great job and its very useful for the users. Thank you so much for your effort.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome and glad to hear that!
@ScriptRaccoon
@ScriptRaccoon 2 жыл бұрын
This is a nice application of using middleware, thank you! I think the grammar thing was actually good since it gives the user a very human-like and easy to read feedback. I have a suggestion for refactoring. In the file size and file extension middlewares it is easier to get the sizes and extensions with a filter applied to the Object.values array. In fact, we don't need the keys as far as I can tell, and the loop can be replaced by the filter Array method.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! And that refactor sounds great!! Excellent comment! 💯🙏🚀
@kobibentata
@kobibentata 3 ай бұрын
What a great video!! 🏆 Well explained, well done! After busting my brain with the issue of file upload in Node for so long, I was so happy to encouter this video. Thanks.
@neenus
@neenus Жыл бұрын
I just want to say thank you for sharing your knowledge .... I was here looking for a way to show progress of your file upload while it's uploading but this was still nice to watch as always you explain topics in a very clear way that anyone can understand!
@aishwaryshah3823
@aishwaryshah3823 2 жыл бұрын
This person comes with absolute best example . sir i love your code thank you
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, Aishwary! 🙏
@bilza2023
@bilza2023 Жыл бұрын
Great Video. Text is bold and visible. Explanation is so clear and precise. Excellent delivery.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear that!
@anandv1391
@anandv1391 3 ай бұрын
Progress over perfection❤
@johnpaulpineda2476
@johnpaulpineda2476 2 жыл бұрын
finally a good tutorial on file uploading
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you, John! 💯
@lloydtea2762
@lloydtea2762 9 ай бұрын
Hello Dave, Your react tutorials has been a blessing to me... Please was this project ever done in react ?
@savvyprogrammer
@savvyprogrammer 2 жыл бұрын
Best video in yt I have ever seen. Can u please make a separate video about Multer middleware stored in database like SQL, noSQL with MVC pattern? your video is far better then Udemy paid course. Appreciate your hard work 🙏
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the kind words! And great request! I want to do that, too 💯🚀
@savvyprogrammer
@savvyprogrammer 2 жыл бұрын
@@DaveGrayTeachesCode thanks a lot sir I have just done🙏
@EduardoOrnelas
@EduardoOrnelas Жыл бұрын
Dave, I want to add my compliments to the many you already have! Your instructions are crystal clear and allowed me to implement your solution into my project with very few updates as changing the repository path for uploaded files and saving the metadata to my database. I just want to ask you if you have a tutorial on retrieving the files from the server to allow users to open their files. Thank you very much!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you for the kind words! I do not have a tutorial specific to downloading files. However, after learning about Node.js with Express, you should be able to implement the response.download method documented here: expressjs.com/en/5x/api.html#res.download
@inanismailov
@inanismailov 7 ай бұрын
i very much enjoyed following along and will be applying my new knowledge to my personal projects. Thank you for this excellent content, Dave. P.S. It would be excellent if you could do this using react. I believe you mentioned to let you know in the video.
@ahmad-murery
@ahmad-murery 2 жыл бұрын
Happy to see the return of vanilla JS 💪😁 (I don't know why but I always like to get the most out of native tools) anyway, we may use for-of loop to shrink this code Object.keys(files).foreach(key => { files[key].something }) to this: for(let file of files){ file.something } Thanks Dave
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thanks Ahmad! Yes, complete preference for choice there. Sometimes I use Object.keys() and sometimes for...of. I should probably consistently choose one only 😃
@ahmad-murery
@ahmad-murery 2 жыл бұрын
@@DaveGrayTeachesCode I use the first thing comes to my mind and can't be consistent even on the same project 🤦‍♂ anyway, I enjoy finding alternatives it keeps my brain active (if any 😁)
@rustee_nyfe
@rustee_nyfe 9 ай бұрын
I think that message (with "is" and "are" ternaries, etc) is gorgeous. Sometimes I'm too lazy to do that and I feel guilty about that.
@NOTHING-en2ue
@NOTHING-en2ue 9 ай бұрын
very well tutorial, i used this code in my own project and it worked very well thanks a lot ❤
@andresbreuer
@andresbreuer 2 жыл бұрын
Thanks Dave! Loved it. It would be nice to have a video on uploading photos to a data base like Mongo.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you and great request! 💯
@mahendranath2504
@mahendranath2504 2 жыл бұрын
You have an amazing content, I believe there will be full node and backend development long video soon 😎😉👍👍👍
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏 I do have a Node.js full course here: kzfaq.info/get/bejne/nJh1pKh0zrqmfGw.html
@mahendranath2504
@mahendranath2504 2 жыл бұрын
@@DaveGrayTeachesCode wow , yes I bookmarked it as well
@memduhcevik
@memduhcevik Жыл бұрын
I'll be so glad if you prepare a video about streams, process, buffers in nodejs, sir :))
@Why-Ron75
@Why-Ron75 18 күн бұрын
This is a great tutorial, And therefore I'm a new subscriber :) Thank you, Dave! Having said that, you've mentioned few times along the video that you might share of the client side code for uploading files with React as well. Did you end up doing so? And if not, will you, please?
@bwanamaina
@bwanamaina 2 жыл бұрын
i like how you clearly explain; you got a new subscriber ✌️
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the kind words 🙏
@relaxspacee
@relaxspacee Жыл бұрын
Thanks for creating this video it really help
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad it helped!
@quofintech9200
@quofintech9200 2 жыл бұрын
Another great video Dave, Thanks!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome! 💯
@willyhorizont8672
@willyhorizont8672 2 жыл бұрын
Yes please make tutorial uploading image from react to node express server and store the images in drive using fs 🙏
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the request! 💯
@emmanueloluwafemi7236
@emmanueloluwafemi7236 Жыл бұрын
I bought paid courses and this guy channel is better. So crazy 😂😂😂😂😂
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you for the kind words!
@Evan-Lab
@Evan-Lab Жыл бұрын
Thank you very much you help me so much with this video
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad I could help!
@zeeshan4341
@zeeshan4341 2 жыл бұрын
yes plz make it as a MERN project. love ur videos . keep it up 👌
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 💯
@siddiqahmed3274
@siddiqahmed3274 2 жыл бұрын
Thank you so much. i have been looking video on file upload
@siddiqahmed3274
@siddiqahmed3274 2 жыл бұрын
If you would make a react video on it, then please do try to make little change to backend code as well for duplicate name files. We should try to name incoming files something different so they may not get overwritten
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You can add that option if you wish. Check if the file exists on the server and rename the upload before saving if it does.
@sergeyplotnikov5031
@sergeyplotnikov5031 2 жыл бұрын
Thank you very much! It is really helpful!
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad to hear it! 🚀
@Terra028C
@Terra028C 9 ай бұрын
I love this tutorial! How would we modify this if we wanted to store the files in a database like postgreSQL?
@mohamedabdelmaksod660
@mohamedabdelmaksod660 2 жыл бұрын
Thanks Dave what an amazing tutorial 👏 Appreciate if you can extend the tutorial to cover converting images to base64 string type and then save it to database Thanks again.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome and that's a great request! In the meantime, this tutorial has some of what you are asking for - the base64 part: kzfaq.info/get/bejne/oKuaopyG3trUeZc.html
@alimov2345
@alimov2345 Жыл бұрын
thanks for best content
@mohammednoor1330
@mohammednoor1330 Жыл бұрын
loved your video❤
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@shin5302
@shin5302 2 жыл бұрын
Thank you for your video, Dave! Can you also make the video about the download file with express? Please.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the request! 🙏
@newnormal7365
@newnormal7365 2 жыл бұрын
Hi Dave Grey for the next video i would like you to cretae a video that show the way to generate report to PDF and Excel when the user send a request to backend (Express). this content will be very useful for many people (that include me :) )
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the request! It won't be next, but I'll add it to my request list.
@imigi427
@imigi427 Жыл бұрын
OF course, when I search for the information how to do something. There's have to be Dave Gray video tutorial on how to do it
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you for the kind words! 🙏 I'm working on a Typescript series very soon. 🚀
@riyazahmed2581
@riyazahmed2581 24 күн бұрын
can you show the same using react as frontend ...Thanks
@angeloalessandro
@angeloalessandro Жыл бұрын
Great course! It helped me so much. I have a question, how do you do to paste code from nowhere?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You cannot paste code from nowhere. During a tutorial, I might have another VS Code instance open off screen that I copy something from.
@subliminakeys1674
@subliminakeys1674 Жыл бұрын
thank you, this is great , perfect timing, I just happen to need this for my current project. Can you not use axios for this or did you just choose fetch randomly for this example? Can you possibly point me in the right direction on what I would need to research if I wanted to implement a crop photo option before upload or maybe it would be after? It would be to use the image for a profile photo but allow the client to crop it so the most important part of the image is displayed in the bubble.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
If allowing the client to crop, I would look for a client-side solution - maybe on npmjs.com. I just used fetch, but you could use Axios or other API layer options.
@nandopookey9195
@nandopookey9195 11 ай бұрын
Thanks sir
@derbundy3909
@derbundy3909 2 жыл бұрын
Really good tutorial, thanks! Based on this, is it possible to integrate a progress bar in the frontend?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Last I looked into creating an accurate progress bar, fetch did not support it - but the older XMLHttpRequest did. There may be some npm packages that make it easier. I created a progress bar for image upload in this tutorial: kzfaq.info/get/bejne/oKuaopyG3trUeZc.html
@derbundy3909
@derbundy3909 2 жыл бұрын
@@DaveGrayTeachesCode Yes, thank you. I modified the sendFiles function a little bit, ... const sendFiles_xhr = async() => { //Object const myFiles = document.getElementById('myFiles').files //all files user selected const formData = new FormData() //Bind file data to the form Object.keys(myFiles).forEach(key =>{ formData.append(myFiles.item(key).name, myFiles.item(key)) }) //Send to backend alternative var xhr = new XMLHttpRequest(); xhr.open('post','localhost:3000/upload',true); xhr.upload.onprogress = (e) => { if(e.lengthComputable) { var percentage = (e.loaded / e.total) * 100.0; console.log("Progress in %", percentage.toFixed(0)) } } xhr.onerror = (e) => { console.error("Error! No response from server. This may caused by a network error.") } xhr.onload = () => { console.log('XMLHttpRequest transaction completes successfully'); } xhr.onreadystatechange = function() { // Call a function when the state changes. console.log("Ready with status", this.status," ", this.responseText); if(this.responseText.length==0) { console.log("No Response text!") return; } let json = JSON.parse(this.responseText); console.log("Response message is: ",json?.message); const h2 = document.querySelector('h2') h2.textContent = `Status: ${json?.status}` const h3 = document.querySelector('h3') h3.textContent = json?.message if (this.readyState === XMLHttpRequest.DONE && this.status === 200) { // Request finished. Do processing here. } } xhr.send(formData); }
@user-iu6hu8oq5p
@user-iu6hu8oq5p Жыл бұрын
Thanks for the tutorial! Btw what extension or setting are you using for highlighting syntax? I noticed that in your editor the opening and closing brackets are connected with a line (not just highlighted) which would be awesome.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
I explain how to add the lines here: kzfaq.infoMDaxWffMjrQ
@insomniacno0ddy573
@insomniacno0ddy573 2 жыл бұрын
Hey Dave, awesome tutorial , can you please tell me how I can change the path of saved files meaning if I want to save somewhere else and divide them into different folders like image files separated from doc files.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
In that case, you would need to look at the file extension and create the save path based on that information. Notice how I used path.join() to create the paths. If you aren't too familiar with Node.js, starting with my Node.js course would really help out: kzfaq.info/get/bejne/nJh1pKh0zrqmfGw.html
@loikvokhidov7688
@loikvokhidov7688 Жыл бұрын
Hi Dave, do you have a course on Udemy?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
I do not. I do plan to release a premium course at some point. I won't put it on Udemy though.
@muthaphuliavhakholwi9743
@muthaphuliavhakholwi9743 2 жыл бұрын
Dave you can create React JS for this file upload
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you for the request! 💯
@obettaaugustine3383
@obettaaugustine3383 Жыл бұрын
Thanks Dave, love your tutorial! I was trying to use an external script for the javascript but it's not working even after using the same code. What might be the issue?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
I have no idea. I did not use an external script in this tutorial. I do not know anything about the script you are trying to use, and I cannot see your code. No way I could know the answer. Consider joining my Discord where you can share your code and myself and others can answer questions: discord.gg/neKghyefqh
@obettaaugustine3383
@obettaaugustine3383 Жыл бұрын
@@DaveGrayTeachesCode alright thanks,I will join the link now
@Jasper_L
@Jasper_L 2 жыл бұрын
very useful video
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Glad to hear that! 💯
@subliminakeys1674
@subliminakeys1674 Жыл бұрын
All of the file upload tutorials I've seen other than this one seem to use multer. Do you prefer this method instead of multer?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
No preference, but I just used this one at the time.
@henighodbane3501
@henighodbane3501 Жыл бұрын
Hey Dave, could you please make a sample tuto for a file upload using GraphQL mutation (file within variables e.g. queryInput: {firstname, lastname, image} ) thanks
@krzysztofpilch6307
@krzysztofpilch6307 Жыл бұрын
This is some cool asynchronous upload handling script. Creating formdata object and passing into fetch with await wrapped into async function and then taking resolve in json format with optional chaining. That’s really cool, but why express-fileupload and not Multer as an middleware?
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Often more than one choice of middleware will meet the requirements you need. All I needed was express-fileupload. I have had other requests for a multer example and can do one this year.
@krzysztofpilch6307
@krzysztofpilch6307 Жыл бұрын
@@DaveGrayTeachesCode I would be definitely interested. All the best.
@sohaibesohaib2914
@sohaibesohaib2914 Жыл бұрын
how to rename the file before saving it to the our folder ?
@abdulrahmanagboolaosho3582
@abdulrahmanagboolaosho3582 Жыл бұрын
could you please make a video on websocket
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Good request!
@abdulrahmanagboolaosho3582
@abdulrahmanagboolaosho3582 Жыл бұрын
@@DaveGrayTeachesCode pls also do a react native tutorial and a python tutorial
@user-ih9wm5hu6f
@user-ih9wm5hu6f 8 ай бұрын
How can i use hls in node js ?
@chandrawardhana5884
@chandrawardhana5884 2 жыл бұрын
very interesting material, permission to ask, how to upload this file consumed by api gateway? does the api gateway also have to have a multer and a storage folder? thanks
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
This tutorial uploads a file to an API. It also stores the file on the server. Using multer is another approach that differs from this video.
@chandrawardhana5884
@chandrawardhana5884 2 жыл бұрын
@@DaveGrayTeachesCode thank you for replying to my comment. i've used multer in my api gateway but i only managed to send the file into the api gateway folder not in the parent API/service I'm calling. do you have turorial for this? Thank you
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
@@chandrawardhana5884 I do not currently. It sounds like you want to relay the image from your backend API to a 3rd party API. It is possible.
@chandrawardhana5884
@chandrawardhana5884 2 жыл бұрын
@@DaveGrayTeachesCode more precisely I want to send an excel file to a certain service using the api gateway that I have created. the gateway api is only an intermediary
@juressic3881
@juressic3881 2 жыл бұрын
Great tutorial!! Is it possible to upload files by http post request only from postman or others? I need to upload video and photos files from game engine Unity.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 💯 It is not mine, but here is a nice short video on how to do that: kzfaq.info/get/bejne/iZ2Sqs6q2JyoYHk.html
@juhandvan
@juhandvan 2 жыл бұрын
Hi Dave, I'm a little confused about this section: Object.keys(myFiles).forEach(key => { formData.append(myFiles.item(key).name, myFiles.item(key)) }) So I wonder why do you use "myFiles.item(key)" over "myFiles[key]". Is there any difference between them ?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
There is a difference. You are referring to the JS in the form of the index.html file. myFiles is a FileList. FileLists have an item() method (MDN: developer.mozilla.org/en-US/docs/Web/API/FileList) so I am calling that method to return a file object. myFiles[key] would be correct if myFiles was a single object, and you wanted to reference the property of the object with that specific key.
@medkha6443
@medkha6443 2 жыл бұрын
Hey thanks for this! Can I upload csv file and convert it to JSON or object?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
This tutorial shows how to upload any file type, but it does not show how to process a CSV or convert it to JSON. That would be a good project! 💯
@ableez
@ableez Жыл бұрын
please use react to create the form.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Will do!
@dharmeshgohil9375
@dharmeshgohil9375 2 жыл бұрын
Nice one can you make stripe payment video in node js
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! I should look into that 🚀
@oussemabouyahia474
@oussemabouyahia474 Жыл бұрын
can you please do it with react front end
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you for the request!
@imtiyaj789
@imtiyaj789 2 жыл бұрын
Which theme u r using in vs code? Could you please tell me?
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
GitHub theme 🚀
@arunkumar-tn5gu
@arunkumar-tn5gu Жыл бұрын
Could you please do a file upload with react.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thanks for the request!
@raba650
@raba650 2 жыл бұрын
How about a tutorial on express.js file upload without using packages like multer or express file upload.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Like this one: kzfaq.info/get/bejne/oKuaopyG3trUeZc.html
@cgolebio
@cgolebio 2 жыл бұрын
Hey Dave, Great explanations and methods. I’ve been trying to create a React app and do some pre-processing there. Scenario 1: - I don’t need to store the file, but I need to process csv data. So I validate the file extension, headers, etc. in React and then push the data to the API once the file and data checks out. - my struggle with this is providing loading status for multiple files. I use a state array, but doesn’t always re-render the component for some reason until another state change later. Scenario 2: - uploading jpg files. This video couldn’t have come at a better time! - is it better to process the file with express? Or should some preprocessing be done with react? In both scenarios I am playing with react-dropzone vs standard input field and button. Appreciate and value your thoughts.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thanks Christopher! 🙏 Let's look at both: #1: Fetch does not provide a loading status. See what npm packages are available for this if any. The loading statuses I've seen are faked. If you find a solid solution, please share. Join my Discord to share with others, too. Link in header of my channel. #2: I would process the file after it is received. That doesn't mean with Express, but with whatever npm package you need in the Node.js environment.
@cgolebio
@cgolebio 2 жыл бұрын
@@DaveGrayTeachesCode thanks! I guess the overarching opinion is let the api do the processing work; just use react to quickly validate and send the data and process the response. Correct? Also, I wasn’t meaning that I was doing loading status with fetch. Sorry for that confusion. I am ok with async/await. The question is probably better directed on the react tutorial where you talk about managing state and how arrays are handled on state changes. I’ll go back and rewatch.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
@@cgolebio correct!
@jinx12373
@jinx12373 2 жыл бұрын
What did the semicolon ever do to hurt you? Why don't you show my boy some love );
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
He was my buddy for years, but I'm trying to break the habit and lose his digits. 😆
@mohamedyoussef8835
@mohamedyoussef8835 2 жыл бұрын
Awesome Tutorial +++++++++++++++++++++++++ Thank You
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
You're welcome, Mohamed! 💯
@mutasimahmed8975
@mutasimahmed8975 2 жыл бұрын
Hey Dave, any plans of launching a paid course
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
I do want to. I hope to start building one later this year. 🚀
@mutasimahmed8975
@mutasimahmed8975 2 жыл бұрын
@@DaveGrayTeachesCode yes please do so make a project based course which is beyond basics ...I am looking forward to buy something from you if its of great value . I really appreciate all this free contect thank you for teaching me redux and stuff
@mrbilchalan
@mrbilchalan 2 жыл бұрын
@shekhtalha286
@shekhtalha286 2 жыл бұрын
take love
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 жыл бұрын
Thank you! 🙏
@mariusguissou4282
@mariusguissou4282 2 жыл бұрын
👍👍👍👍👍👍👍👍👍👍👍👍
@user-rx2fo5dh9t
@user-rx2fo5dh9t Жыл бұрын
Great tutorial but the entire time I was screaming GET TO THE POINT
@nicooow869
@nicooow869 11 ай бұрын
thank u wise man
@tsaismile4801
@tsaismile4801 Жыл бұрын
Thank you very much! It is really helpful! Hi Dave, I'm a little confused about how to change and setting the url "localhost:3500" by enviorment setting in index.html this section: const response=await fetch('localhost:3500/upload',{ method:'POST', body:formData }) Thank you very much!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You would not use an environment variable in an html file. In your Node.js files, you can refer to environment variables with process.env.VARIABLE_NAME_GOES_HERE - I cover this and much more in my Node.js for Beginners course here: kzfaq.info/get/bejne/nJh1pKh0zrqmfGw.html
How to Upload Files in Node.js Using Express and Multer
6:52
James Q Quick
Рет қаралды 49 М.
I built the same app 10 times // Which JS Framework is best?
21:58
Fireship
Рет қаралды 2,5 МЛН
Люблю детей 💕💕💕🥰 #aminkavitaminka #aminokka #miminka #дети
00:24
Аминка Витаминка
Рет қаралды 532 М.
Yum 😋 cotton candy 🍭
00:18
Nadir Show
Рет қаралды 7 МЛН
Uploading an Image | Creating a REST API with Node.js
21:34
Academind
Рет қаралды 458 М.
Building web server with node and bun
25:22
Hitesh Choudhary
Рет қаралды 25 М.
Passing Data Between Frontend and Backend | Node.js
18:31
Smoljames
Рет қаралды 87 М.
NodeJs How to upload Files + uploading to AWS S3 using Express, Multer
1:16:31
Sanjeev Thiyagarajan
Рет қаралды 46 М.
How To Manage User Roles In Node.js
22:45
Web Dev Simplified
Рет қаралды 307 М.
Node.js Crash Course
2:06:35
Traversy Media
Рет қаралды 159 М.
HTML File Uploads in 5 Minutes (Plus Some JavaScript Features)
12:44
Люблю детей 💕💕💕🥰 #aminkavitaminka #aminokka #miminka #дети
00:24
Аминка Витаминка
Рет қаралды 532 М.