Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering what the standard/best practice is with regard to managing user-uploaded images.

Obviously there needs to be a way to limit file sizes, but what's the best and most common practice here -- limit the size of the image that can be uploaded by the user, or reduce the size once it's uploaded on the back-end?

Thanks for any guidance!


share|improve this question
As far as possible, don't make the user do ANYTHING more than simply uploading the image. The smallest of additional tasks can turn off many users. – KK. Jul 10 '11 at 4:39

It depends on what you're aiming for.

If your service is aiming to be all accommodating like Facebook or Flickr, where the user can't do anything wrong, then process the images as necessary to create thumbnail images.

If you're pushed for resources (computationally, space, etc.), limit the size of the image(s) the user can upload. This places the onus on the user's side.

share|improve this answer
Couldn't agree with you more. Depends on the mentality of what is and isn't allowed by the user. – alvincrespo Jul 9 '11 at 19:38

I am not a professional in such things but most back-end servers I know have such preferences to decide the max file size for uploads.

If you decide to reduce the size of the uploaded image once it is uploaded on the back-end then this check is already done, so you have to implement something that check the filesize one more time after the reducing process.

Best regards, Thomas

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.