When client uses IMG tag, file goes as binary to backend, who actually converts this binary data into image file? Does AWS S3 stores binary and convert into an image file and gives path back to the backend server?
You will have to handle it in your backend. Typically, you load the binary, convert it into an image file, and then upload the image to S3. Then you store the S3 URL in your database.
Please respond! When you say "do not store image directly into database as binary data" do you men that we should not store it directly in the webhosting ej: Hostgator? should we always look for external applications like AWS, Coudinary... Thank you for responding!
If you have multiple users all uploading their images to the same s3 bucket though then how do you prevent a malicious user from accessing other peoples images?
a Question please : what if we only want to give the access to the image only if the request came from out app, and deny access from other places,. For example if we paste directly the resource URL in browser the access will be denied
Think it'd be something along the lines of setting your s3 bucket private, then when getting the image you want to get it throught the backend and sending it to the front? that way you can control access through your app
wish you will see my comment ! I have a problem with organization in general Should I store all images in one folder ? even if I have 10 millions images !!! or I should create multiple folders in the images folder ? if yes, depending on what ? on the user ? well if on the user then it is not a good idea you know not only storing images, I mean if we take facebook as an example you create Post so it stores all posts in one folder ( I should call it documentary in mongoDb I guess anyway ) that will be hard to search for on post just with an ID and there are millions of posts
I think there are multiple ways to implement this. I would recommend thinking less about "folders" and more about your "file name" to create some kind of a hierarchy.
i thought i finnally found a way to store image using file system. but nah. here we are again with the same shyt. why is it so hard to find a single fuking video about this where millions of website using file system.
Awesome video, man! You are helping me to be a better dev!
That means a ton! These are helping me grow a ton too : ) Glad you enjoyed it.
THANKYOU FOR EXPLAINING THIS! I need explanations instead of just instructions- so much more useful!
Excellent video. It helped me a lot for report. keep up the good work.
Glad it helped!
Nice video!
So instead of putting the image directly into your database, you store it in a file storage system and store the path+name inside your database.
Yup that's correct! : )
Absolutely amazing video man, thank you very much for covering this topic.
When client uses IMG tag, file goes as binary to backend, who actually converts this binary data into image file? Does AWS S3 stores binary and convert into an image file and gives path back to the backend server?
You will have to handle it in your backend.
Typically, you load the binary, convert it into an image file, and then upload the image to S3. Then you store the S3 URL in your database.
I unintentionally figured this out because I failed to put the image in my actual database/retrieve it so I just used S3 and a CDN
Please respond!
When you say "do not store image directly into database as binary data" do you men that we should not store it directly in the webhosting ej: Hostgator? should we always look for external applications like AWS, Coudinary...
Thank you for responding!
AWS S3 is a good choice!
If you have multiple users all uploading their images to the same s3 bucket though then how do you prevent a malicious user from accessing other peoples images?
Hi! This was just for demo purposes. Realistically you would have much stronger security and AWS policies built in.
ty
a Question please :
what if we only want to give the access to the image only if the request came from out app, and deny access from other places,. For example if we paste directly the resource URL in browser the access will be denied
Think it'd be something along the lines of setting your s3 bucket private, then when getting the image you want to get it throught the backend and sending it to the front? that way you can control access through your app
@@vasiledamian8661 thanks a lot brother
após algumas horas procurando finalmente encontrei alguem que explique oque eu estava tentando entender.
nice video bro!
wish you will see my comment !
I have a problem with organization in general
Should I store all images in one folder ? even if I have 10 millions images !!! or I should create multiple folders in the images folder ? if yes, depending on what ? on the user ? well if on the user then it is not a good idea you know
not only storing images, I mean if we take facebook as an example
you create Post so it stores all posts in one folder ( I should call it documentary in mongoDb I guess anyway ) that will be hard to search for on post just with an ID and there are millions of posts
I think there are multiple ways to implement this.
I would recommend thinking less about "folders" and more about your "file name" to create some kind of a hierarchy.
i thought i finnally found a way to store image using file system. but nah. here we are again with the same shyt. why is it so hard to find a single fuking video about this where millions of website using file system.
Did you figure it out? If so, how??