Brother awesome video, exactly what i was looking for...any idea what should be the workflow when we want to update an entry in the mongodb...and want to upload a new picture.
This is the wonderful video for Node js ever seen it helps a lot. 🔥🔥🔥🔥🔥 one more thing how can we get multiple images from mongo using cloudinry as flipkart or amazon has , like single product have multiple images like that how we can create can u please help ?? like if we click on the product it fetches multiple images for that product... plz help on this
How to change temp files location? I'm using a serverless read-only server which allow write only one location. How can I set cloudinary to store on that location ? The default location isn't working
with FormData new data posting is simple flow. but when we try to edit at that time flow might be confusing little bit because there is 2 scenario 1 - if the user does not change the image so at that time we don't want to re-upload image at that time we just get simple url instead of image object 2 - if user change image so at that flow is simple becuase now we get image object so we can follow add image flow So can you tell me how can we handle both scenario from Backend side
add a another middleware before the CreateUser or UpdateUser middleware and write a condition inside that middleware : const checkIfImageIsChange = (req, res, next) => { // Instead of image add the name of the key with which you have request from frontend if(!req.files.image){ next() } // Write the image upload logic here } so If user would not change image then it just goes to next middleware or Incase if user uploaded the image then the above condition will be false the the below code will execute and upload user picture. Note : If user is already created and he is updating data later then just use PATCH Instead of PUT and put this middleware in before the update middleware.
sir ek bat batayiye ki jab folder me photo upload kar lete hai jo ki hosting me (jaha ham apni website host karte hai ) to fir alag se cloudinary kyi use kare.... akhir cloudinary paise charge karega.... zarurat kya hai cloudinaruy ki....kyu use kare.....
Agar aapki hosting company ye chiz provide kr rahi hai ki jaha aap apne API ko deploy kroge waha aap file store kr sakte ho to phir aap multer use kr k aap wahi store kr lo jaise aws wagera dete hai...... Bat backend API ki hai
@@aryakishan4979 in productuon you cant upload image directly to 3rd party server. Image must be saved on the server as well to perform sny other operation.
@@aesthetic_vibes_404 it's done I saved the file temporally in backend and when it gets uplaod to third party then it automatically delete it from backend
Thanks, I tried so many techniques to upload an image but not a single worked but seeing your video it just took me 10mins to upload the image
Thanks I was Searching this thing from 2 weeks now finally found best solution
Thanks! you're a gem
Thanks, my file was not uploading, you saved me.
thanks. it's helped me too much.
Ek no boi♥️
Sir very awesome video
Hello, I have multiple folders in cloudinary, I want fetch all folders in once, can u please help? Thanks
Brother awesome video, exactly what i was looking for...any idea what should be the workflow when we want to update an entry in the mongodb...and want to upload a new picture.
Thank U So much✨
Thank you~!
Love you brother
Bro Multiple images ksa set kr skta hai database ma ya tho just single image set horahe hai if someone have any idea plzzz share
This is the wonderful video for Node js ever seen it helps a lot. 🔥🔥🔥🔥🔥 one more thing how can we get multiple images from mongo using cloudinry as flipkart or amazon has , like single product have multiple images like that how we can create can u please help ?? like if we click on the product it fetches multiple images for that product... plz help on this
im getting error like undefined can you help me
How to change temp files location? I'm using a serverless read-only server which allow write only one location. How can I set cloudinary to store on that location ? The default location isn't working
Hi brother i am in your place now can you please tell me how to overcome this problem
sir same process repeat kiya hai par req.files.photo usko mi nhi raha hai blank aa raha hai
with FormData new data posting is simple flow.
but when we try to edit at that time flow might be confusing little bit because there is 2 scenario
1 - if the user does not change the image so at that time we don't want to re-upload image at that time we just get simple url instead of image object
2 - if user change image so at that flow is simple becuase now we get image object so we can follow add image flow
So can you tell me how can we handle both scenario from Backend side
add a another middleware before the CreateUser or UpdateUser middleware and write a condition inside that middleware :
const checkIfImageIsChange = (req, res, next) => {
// Instead of image add the name of the key with which you have request from frontend
if(!req.files.image){
next()
}
// Write the image upload logic here
}
so If user would not change image then it just goes to next middleware or Incase if user uploaded the image then the above condition will be false the the below code will execute and upload user picture.
Note : If user is already created and he is updating data later then just use PATCH Instead of PUT and put this middleware in before the update middleware.
hi Big bro please make video same on firebase image store and get url for mongoDB please it will be very help full for beginners
Fakepath ko kese resolve kre jb me react ke sath use kr rha hu
Thanks like kar diya subscribe tab karunga jab mera code chalega
sir ek bat batayiye ki jab folder me photo upload kar lete hai jo ki hosting me (jaha ham apni website host karte hai ) to fir alag se cloudinary kyi use kare.... akhir cloudinary paise charge karega.... zarurat kya hai cloudinaruy ki....kyu use kare.....
Agar aapki hosting company ye chiz provide kr rahi hai ki jaha aap apne API ko deploy kroge waha aap file store kr sakte ho to phir aap multer use kr k aap wahi store kr lo jaise aws wagera dete hai...... Bat backend API ki hai
But if i want to upload image directly to the cloudinary without posting it to temp file in server.
If u found the solution then pls reply back
@@aryakishan4979 in productuon you cant upload image directly to 3rd party server. Image must be saved on the server as well to perform sny other operation.
@@aesthetic_vibes_404 it's done I saved the file temporally in backend and when it gets uplaod to third party then it automatically delete it from backend
@@aryakishan4979 okk
i m getting error ..my file is not uploading
cant find base url
Is it can upload pdf file?
With jwt authentication
Can u give the GitHub link of this repo
Bhai kb tak aaye ga mern stack beginner tutorial
sir ye code dee sakte hoo kaya thodi help hoo jayegee
Make videos on python
Ok
Thanks
@@sbsonlineclasses5963 You can put the code on GitHub please ? I try to do the same, and i fail :( . Thanks a lot
api base url nahi mil raha
Did u get it??
.