07-14-2008, 07:11 AM
|
#12 (permalink)
|
|
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
|
I wouldn't trust a file to be what it says it is, you may want to check out getimagesize() or mime_content_type() to get a definite result. With your method however, your method of getting the file extension breaks if there's multiple periods in the filename, so I'd suggest the following two lines:
PHP Code:
$allowed_filetypes = array('jpg','gif','bmp','png');
// and
$ext = substr(strrchr($filename, '.'), 1);
-m
|
|
|
|