Limiting File-Size for Uploads?

My website allows a user to upload a photo of him/herself, which will in turn be converted to a thumbnail that will appear as a Profile Picture/Thumbnail.

Currently my script requires that uploads be no larger than 150 Kb.

Is that a problem in anyone’s eyes?

Since my PHP uses GD to convert the uploaded image into a thumbnail, and since my code deletes the original uploaded file after it has been converted to a thumbnail, I suppose allowing larger file-sizes would be okay. And yet, I think 150 Kb is sufficient.

Comments?

Thanks,

Debbie

The average user won’t know how to reduce the image to 150kb, so most will be locked out by this restriction.

So what is a more reasonable upper file size?

(I believe some of the PHP code I am using might not work for file sizes over 2MB or was it 2GB?!)

Debbie

Ummm… SitePoint’s limit is a measly 64Kb, so while the double-standard for me?! :wink:

Debbie

Where do you get that limit from? I regularly take screen shots and post them here, and they are often around 250-500kb. I would prolly allow around 1mb … as long as the backend can reduce that, of course.

Is there any method to reduce the file size by coding or we have to do it manually?

It’s done automatically via PHP, once you’ve told PHP what to do.

If you click on “My SitePoint”, and then click on “Edit Avatar” you see…

Note: The maximum size of your custom image is 75 by 75 pixels or 8.0 KB (whichever is smaller).

If you click on “My SitePoint”, and then click on “Edit Profile Picture” you see…

Note: The maximum size of your custom image is 160 by 100 pixels or 64.0 KB (whichever is smaller).

Looks like I’ll have to crack open the PHP Manual, and scutenize my code and functions again, and make sure none break at certain sizes. (I think they are all good under 2MB.)

Anyone else have thoughts or practical experience with this topic?

(Being a Mac user, and considering that I can resize photos for free on OS X, I guess I didn’t think it was such a big deal if someone has to resize a photo so it is < 150Kb?!) :-/

Sincerely,

Debbie

Okay, Ralph, I changed my script to allow up to 2MB Photo uploads!! :stuck_out_tongue:

It works okay, although I have a lot of Question about Memory Limit in php.ini.

Thanks,

Debbie