lopes_andre Posted August 24, 2010 Share Posted August 24, 2010 Hi, I'm developing a code that uploads images. I need to verify if the image have the minimum size of 100*100 pixels before the upload. How can I do this? Best Regards, Sorry for my bad english. Quote Link to comment https://forums.phpfreaks.com/topic/211633-how-to-validate-the-size-of-an-image-before-the-upload/ Share on other sites More sharing options...
Alex Posted August 24, 2010 Share Posted August 24, 2010 getimagesize Quote Link to comment https://forums.phpfreaks.com/topic/211633-how-to-validate-the-size-of-an-image-before-the-upload/#findComment-1103249 Share on other sites More sharing options...
CroNiX Posted August 24, 2010 Share Posted August 24, 2010 You asked how to get the size before the upload, and you can't because it isn't on the server yet and afaik, there is no javascript that will give you accurate results. You allow the upload, and then validate it once its on the server, including its size, and either accept the upload or reject it. There might be some flash upload script that can verify the size before upload, but you can't with php. Quote Link to comment https://forums.phpfreaks.com/topic/211633-how-to-validate-the-size-of-an-image-before-the-upload/#findComment-1103382 Share on other sites More sharing options...
Alex Posted August 25, 2010 Share Posted August 25, 2010 I was assuming he meant before it's uploaded to a more permanent place on the server. Most of the time when talking about this kind of thing people don't consider a file in a temporary folder to be uploaded, although technically it is. Quote Link to comment https://forums.phpfreaks.com/topic/211633-how-to-validate-the-size-of-an-image-before-the-upload/#findComment-1103391 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.