Page 1 of 1

image size during upload

Posted: Wed Aug 10, 2005 4:49 pm
by s.dot
I've been reading through the manual on file uploads, and it appears the $_FILES array does not contain information on the size (in pixels) of an image being uploaded. This makes sense, because it could not return pixels if the file wasn't an image.

with that said,

Code: Select all

$size = getimagesize($_FILES['filetoupload']['tmp_name']);
does not seem to be working for me.

Is it possible to grab an images dimensions before move_uploaded_file() ?

Posted: Wed Aug 10, 2005 6:27 pm
by feyd
it should be possible..

Posted: Wed Aug 10, 2005 6:36 pm
by s.dot

Code: Select all

$size = getimagesize($_FILES['filetoupload']['tmp_name']);
So that should be working?

Posted: Wed Aug 10, 2005 7:13 pm
by feyd
I don't really see why not.. unless for some odd reason it's not allowed to read the files from that location.

Posted: Thu Aug 11, 2005 1:27 pm
by bokehman
Try doing a readfile($_FILES['filetoupload']['tmp_name']); or similar to make sure you can read the file while it is in it's temp location.