Get image file type

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Sat Jan 22, 2005 4:24 am

Hi

I was wondering if

Code: Select all

$_FILES['submitFile']['type']

returns the actual file type or it just returns
the file type depend on the file EXTENSION?
cause I have a submit system which recognize
file type using that command and once Ive seen
an user submitted a BITMAP file but with the
extension of JPEG.
It was a JOEG file but $_FILES['submitFile']['type'] recognize
it as BITMAP!

so actuslly how can we get a real file type?

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1279
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Mon Jan 24, 2005 7:28 pm

probably you are looking for
mime_content_type

User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Tue Jan 25, 2005 5:39 am

Cheers
Btw do snakes eat ducks? :-o

Post Reply