开发者

php image type, mozila and IE7

开发者 https://www.devze.com 2023-01-27 21:32 出处:网络
i insert image in page and strangely I get a picture of the types. show type with: $_FILES[\'img\'][\'type\'].

i insert image in page and strangely I get a picture of the types.

show type with: $_FILES['img']['type'].

Result:

Firefox: image/jpeg
IE7: 'image/pjpeg'

Firefox: image/png
IE7: image/x-png

Now i use this filter:

$type_filter = array('image/gif', 'image/jpeg', 'image/png', 'image/jpg', 'image/bmp', 'image/x-png', 'image/pjpeg');

It is goo开发者_开发问答d, or something else is missing? Thanks


I usually do something like this:

if(stristr($_FILES['image']['type'], "image")){
enter code here
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号