Jump to content

FINFO


hackalive

Recommended Posts

Hi guys I am using this code:

 

	$file_info = new finfo(FILEINFO_MIME);	// object oriented approach!
$mime_type = $file_info->buffer(file_get_contents($file));  // e.g. gives "image/jpeg"

switch($mime_type) {
	case "image/jpeg":
		echo "IMAGE";
}

 

However the code is returning:

image/jpeg; charset=binary

 

How can I make it so it does not return a charset etc?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/263578-finfo/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.