Тёмный

NodeJS and MongoDB Tutorial #4 - Uploading Files (Single & Multiple) 

Tech Founder
Подписаться 3,1 тыс.
Просмотров 98 тыс.
50% 1

To Download the Source Codes & Postman Collection of full series (8 videos), please click here-
techfoundercre...
Discussed Topics:
i) How to upload file/image in nodejs
iv) How to upload multiple files/images in nodejs
Videos of this Node JS and MongoDB tutorial series:
1) Installation - • NodeJS and MongoDB Tut...
2) Create a Node server - • NodeJS and MongoDB Tut...
3) Complete CRUD Operation - • NodeJS and MongoDB Tut...
4) File Upload (Single & Multiple) - • NodeJS and MongoDB Tut...
5) Complete Login Registration Process - • NodeJS and MongoDB Tut...
6) Authenticate routes - • NodeJS and MongoDB Tut...
7) Refresh Token - • NodeJS and MongoDB Tut...
8) Environment Variables - • NodeJS and MongoDB Tut...
9) Pagination - • NodeJS and MongoDB Tut...

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 74   
@nozkieful
@nozkieful 4 года назад
This is not uploading file to mongodb, it is uploading to server file system then using the static folder path as a reference to mongodb. correct me if i’m wrong.. great tutorial anyway.. thanks.
@piyushaggarwal5207
@piyushaggarwal5207 2 года назад
thanks for saving my time. Everybody is like saving to monogodb. I don't know why. I am tired.
@pp0pp09
@pp0pp09 2 года назад
@@piyushaggarwal5207 use gridFS to store actually in the mongoDB..bt it has a limitation on file size(upto 16MB only)
@nathanmorlonski1265
@nathanmorlonski1265 2 года назад
@@pp0pp09 no, gridFS allows you to upload files MORE than 16MB
@sohigh7433
@sohigh7433 5 месяцев назад
​@@nathanmorlonski1265 MongoDB's document size is capped to 16MB
@geodev
@geodev 3 года назад
You saved my life! Very clear explanation. Thank you very much for the amazing tutorial!
@TechFounder
@TechFounder 3 года назад
Thank you very much
@krishna7440
@krishna7440 4 года назад
bro lesson was literally amazing but it would be very helpful if u could share codes as well or github link
@ShivamSingh-sv6rh
@ShivamSingh-sv6rh 4 года назад
I am not able to get this video above 360p.
@cyan3675
@cyan3675 4 года назад
Yep, i cant use 480p
@sagarp7516
@sagarp7516 4 года назад
Wonderful teaching...clean maintained code... awesome... keep going sir... this type of teaching would help lots of people... thanks once again..I think if u continue like this u will going beat all of the channels...🙂🙂
@jimspatel2407
@jimspatel2407 2 года назад
Thank you so much . To the point video great explanation. Thank you once again 😊
@mohammedshoaib2755
@mohammedshoaib2755 3 года назад
Awsome sir...You are down to Earth
@ankitapaul1031
@ankitapaul1031 Год назад
Hello, I tried uploading file as you said but in my project "uploads" folder I cannot see the file as you mentioned. In POSTMAN, I am getting as Added Employee successfully. But cannot see the object mainly the "avatar" neither in mongodb nor in POSTMAN
@megamarvellous3521
@megamarvellous3521 Год назад
You might need to move the images manually to the uploads folder
@shakilahmed6870
@shakilahmed6870 Год назад
My right ear is felling so alone
@malachitto7113
@malachitto7113 6 месяцев назад
Thank you so much for ur wonderful videos
@bulentyildiz07
@bulentyildiz07 4 года назад
very well done, keep it up. a big thank you to you
@danielklassicug6947
@danielklassicug6947 2 года назад
you have saved my day Thanks alot master🥰🥰
@AmazonFinds-001
@AmazonFinds-001 2 года назад
MulterError: Unexpected field at wrappedFileFilter (D: odejs ode_modules\multer\index.js:40:19) I get this error
@maxmaksum4673
@maxmaksum4673 3 года назад
you are such awesome teacher..you should make mern stack and social media clone
@MkaifMansoori
@MkaifMansoori Год назад
how to update multiple files plz explain i am stuck in this every help is appriciate
@betterbehappythannot3605
@betterbehappythannot3605 Год назад
Is there a link to github or smth?
@tinkun23
@tinkun23 5 месяцев назад
ur video make me bum bum bro, so greatttt
@preshitwtf
@preshitwtf 2 года назад
Thanks sir, This helped me alot
@liveecofriendly1116
@liveecofriendly1116 2 года назад
not only images, also share the code to upload .txt, pdf, excel and other files to mongodb
@tanvirulislam4120
@tanvirulislam4120 2 года назад
how can remove file or delete file from server or temp folder.. please add a separate video.... i personally request for this video
@KundanKumar-sx2vm
@KundanKumar-sx2vm 4 года назад
Amazing tutorial .. great thanks 😍
@kadirramazn
@kadirramazn Год назад
you are great man thanks
@JayanThrissur
@JayanThrissur 2 года назад
Thank you very much .
@darshitashah2986
@darshitashah2986 2 года назад
I am getting this error, can you please help ReferenceError: File is not defined
@NSTuts
@NSTuts 3 года назад
and what is the file upload is there from multiple fields
@boscofan3735
@boscofan3735 2 года назад
how do you use form-data to send boolean or number value? you are sending string only
@fjacyntho
@fjacyntho 4 года назад
Hello Thank you for your video lesson. Ask me a question: How do I include multiple image fields in MongoDB, with the same number of images. For example: image avatar1 = field avatar1 image avatar2 = field avatar2 ... using the upload.array option?
@shivkumartotagi2018
@shivkumartotagi2018 4 года назад
form-data is not working show ing me the same error
@coderx4248
@coderx4248 Год назад
Thanks a lot
@Munnapathania
@Munnapathania 4 года назад
bro i have an doubts in my model schemas regarding images like array inside array so let me know how i can contact with you. If you will able to help me then i will be very thankful to you
@shahzaibali8146
@shahzaibali8146 2 года назад
Error: ENOENT: no such file or directory, open 'uploads/1657119064526.png' Anyone have solution of this problem
@julekamara5699
@julekamara5699 2 года назад
in upload.js look the path line 6
@johnyanastacio1107
@johnyanastacio1107 4 года назад
thank you!!
@viperdamodargaming955
@viperdamodargaming955 4 года назад
want to fetch those comma seperated images help me how can i do ?
@m12652
@m12652 9 месяцев назад
I was expecting a save to MongoDB
@TechFounder
@TechFounder 9 месяцев назад
mongodb don't allow file saving, you must have to save in server
@m12652
@m12652 9 месяцев назад
@@TechFounderof course MongoDB allows saves, it’s a database and has tools for saving files (gridfs). This video is pointless and not what the title suggests
@m12652
@m12652 6 месяцев назад
@@ferreiradelima96 thats why its being pushed as a viable solution then...? Storing files in a database was a bad idea a decade ago, now its not such a bad idea. If you need proper permissions control its a lot easier to implement (and much cheeper) than setting up a file server and domain controller etc.
@stavroskefaleas6320
@stavroskefaleas6320 Год назад
I get upload.single is not a function
@grandmaster705
@grandmaster705 3 года назад
Thanks 🌹
@onphuocnguyen7849
@onphuocnguyen7849 2 года назад
i can't send request with formdata same you
@dangkhanh5328
@dangkhanh5328 11 месяцев назад
Is it can be working with audio files ?
@TechFounder
@TechFounder 11 месяцев назад
yes, upload system is same, but you should allow audio extensions
@Casal0x
@Casal0x 4 года назад
i'm following your tutorial but i have an error, do you have any public repository with the code?
@TechFounder
@TechFounder 4 года назад
Can you share your error?
@klue2708
@klue2708 3 года назад
This only works for png, i don't know why but It didn't work for the jpg
@fierstever1235
@fierstever1235 3 года назад
instead of file.mimetype == "image/jpg" use file.mimetype == "image/jpeg". It worked for me..
@TechFounder
@TechFounder 3 года назад
Yes great addition, thanks!
@fierstever1235
@fierstever1235 3 года назад
@@TechFounder no worries man. Im always happy to help!
@TechFounder
@TechFounder 3 года назад
@@fierstever1235 Thanks, no sir it will works for any kinds of file type. Please just customize your code as you need
@muhammadfarooq4694
@muhammadfarooq4694 3 года назад
I want to upload pdf file rather than jpg or png so can anyone tell me how I can do this?
@TechFounder
@TechFounder 3 года назад
Yes you can do it in same way, just add mimetype for pdf.
@TechFounder
@TechFounder Год назад
To Download the Source Codes & Postman Collection of full series (8 videos), please click here- techfoundercreator-springcom.creator-spring.com/listing/nodejs-mongodb-tutorial
@thepickleic-4362
@thepickleic-4362 4 года назад
Una gran ayuda (Y)
@poojat2137
@poojat2137 4 года назад
can u share this code?
@JWhitty
@JWhitty 3 года назад
this neither creates and upload folder nor populates it with the file even though in my mongoDB I can see the file pathname uploaded and all of my code functions without throwing errors... Why is multer not taking the actual file and making a copy in the Uploads folder? By the way "uploads/" throws errors, but "../uploads" doesnt and everything SEEMS to work but doesn't upload the file to the folder. I have no freakin clue where to console.log() to try to find the error here and see what is / isn't happening with the file "uploaded". I think it's just uploading a string that is the file path and then not actually moving the file
@TechFounder
@TechFounder 3 года назад
Please create a blank uploads folder manually, check directory permission. Check multer properly installed.
@JWhitty
@JWhitty 3 года назад
@@TechFounder directory permission? you don't even do that in your video. I will check this but i thnik it's something else. i already created the folder myself and i did not use "uploads/" because that causes another error saying the directory doesnt exist. "../uploads" from where my middleware "fileUpload" file is seems to work without errors, but isnt uploading/moving the file. Multer cannot be "improperly" installed... I did npm i multer in the project where the package.json is located for my server folder
@JWhitty
@JWhitty 3 года назад
@@TechFounder Error: ENOENT: no such file or directory, open '../uploads/5088_chickenegg.jpg' this is all i get after making the folder (or if i use your code and don't make it, or do make it) nothing ever works
@mathewsjoby6455
@mathewsjoby6455 3 года назад
The whole video was playing on my left ear! try to improve next time
@TechFounder
@TechFounder 3 года назад
Sure, thanks for being with us
@mathewsjoby6455
@mathewsjoby6455 3 года назад
@@TechFounder thankyou for the good, honest and kind reply! good luck
@mathewsjoby6455
@mathewsjoby6455 3 года назад
@@TechFounder by the way can you make a video on how to host this on heroku please? I am not getting the concept properly anywhere! I need it quick cuz I have to submit it soon for my school. Made a beautiful blog but sadly doesn't work because of not being able to publish
@TechFounder
@TechFounder 3 года назад
@@mathewsjoby6455 Can you do it yourself in Heroku if I show how to host in Digital Ocean?
@medhabibbenyoussef9391
@medhabibbenyoussef9391 9 месяцев назад
you're not even teaching you just type like a robot
@SRIDHARI
@SRIDHARI 3 года назад
Thank you 😊
@TechFounder
@TechFounder 3 года назад
You are welcome!
Далее
Uploading Files with React + NodeJS and Multer
11:27
Просмотров 43 тыс.
Uploading Files to MongoDB With GridFS (Node.js App)
55:22
Store Image in Base64 in MongoDB Using MERN Stack
22:35
File Upload Setup - Node.js/Express/MongoDB Course #4
19:24