MariusPro
MariusPro

Reputation: 31

Should my web app upload pictures to a cloud storage by frontend or backend?

I'm building a web app in which people can upload pictures for a user profile and for other things). I'm using node js and express in the back end and Angular 2 for the front end. Which way would be more professional to store uploaded pictures in a cloud storage as firebase? Save the uploaded pictures with my front end or save them with my back end? Thank you for your opinion!

Upvotes: 2

Views: 2622

Answers (2)

Nazehs
Nazehs

Reputation: 558

I don't actually think grabbing stuff from users without serious scrutiny to make sure it's really what you required from the user before getting them into your secure space is a good idea. Probably you need to check and be sure and if checking with the frontend is sufficient then it's your choice. Technical I suggest that you should validate things first using a secure backend language.

Upvotes: 2

0xCrema.eth
0xCrema.eth

Reputation: 887

For me there is no real differences here. But I just want to point out that you should never trust that images uploaded by users are safe.

I would upload them using your back-end because you might want to check if the images are really images and not some code hidden in jpg or to ensure a custom limit size for exemple.

Upvotes: 0

Related Questions