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 PostYou can check the HTTP_POST_FILES array for the actual file size and gracefully reject larger files. There is also a PHP setting max_upload_size which can limit the upload size with a maybe not so user-friendly error message.
The uploaded file can be converted with the GD image library. Or install …
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 …
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.