2 ms·
This isn't the only problem. Not all gifs and jpegs use that MIME [1]. Try this: $allowed_image_types = array('image/gif', 'image/x-gif', 'image/pjpeg', 'im
by technoguyrob 18y ago
This isn't the only problem. Not all gifs and jpegs use that MIME [1]. Try this:
$allowed_image_types = array('image/gif', 'image/x-gif', 'image/pjpeg', 'image/jpeg', 'image/x-pjpeg', 'image/x-jpeg', 'image/x-jpg', 'image/jpg');
if (!in_array($type, $allowed_image_types)) {
$error = 'ERROR: You can only upload GIF and JPG files.';
}
[1] http://www.webmaster-toolkit.com/mime-types.shtml http://www.webmaster-toolkit.com/mime-types.shtml
- whalesalad 18y agoThis is the best method right here, hands down.