I want to limit uploading size of the user image. How can i do this? User should upload only jpg file and it would be less than 100kb. and is there any way i can convert that image into specific resolution? Thanks....

kirtan_thakkar
Recommended Answers
Jump to Postthe uploaded file size can be limited like this
<?php //Notice that 'uploaded' is the name of the upload HTML element if ($HTTP_POST_FILES['uploaded']['size']<100000){ //do your stuff here, storing.. adding to some db.. or whatever } else{ //inform the user, basically whatever you want to happen if the …
Jump to PostIn your form
use<input type="hidden" name="MAX_FILE_SIZE" value="102400" /> <input type="file" .......
this pervents uploads of bigger files on the client side
still need to check the size at the server side
All 7 Replies
smantscheff 265 Veteran Poster
Gewalop 1 Newbie Poster
pzuurveen 90 Posting Whiz in Training

kirtan_thakkar
Gewalop 1 Newbie Poster
smantscheff 265 Veteran Poster
Gewalop 1 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.