Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
if you had to choose one, choose backend, but both is ideal.
get an android library to resize it down to the maximum size, and if someone manages to upload an image bigger than the max size, then reduce it server size.
Sending it to the backend for compression wouldn't be great. Compress from the front end, validate the size from the backend. If the size is too much then reject it
stackiox5922yThis is what you can do and we do this also,
In this type of cases,
You should have a limit of image resolution also,
Like, you can limit a certain resolution and down scale the image and then compress it.
And then again add checks on server side also
mt3o20792yAnd for such cases, ask the user if he wants to upload uncompressed photo. Simple as that.
kurast3212yDeny large files, compress everything else at the server