thx but this is not what i'm looking for. What I want is if user is trying upload lets say 5MB photo and the limit is 1MB, quality of his photo will be automaticaly change so it will fit the limit (in this case 1MB).
With you suggestion user won't be able to upload photo which is bigger then limit, unless he will resize it.