Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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!

Ken

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
add comment

2 Answers

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
1  
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
add comment

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
add comment

Your Answer

 
discard

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.