Jump to content

Get true mime type?


YourNameHere

Recommended Posts

I am trying to write a sub app that is a document manager that will accept .doc and .docx files and save them to a directory on the server for later download.

 

My question is this: After researching the various methods to obtaining the mime type of the file being uploaded, it seems very unreliable.

 

For example, "mime_content_type(); is depreciated, use fileinfo(); instead".

 

The internet is abuzz with people saying that the latter is completely unreliable. This leads me to believe that there is no foolproof way to obtain the mime type of the file if the server is relying on the browser to send the mime.

 

Should the server not be able to decipher .doc is of application/msword ?

 

I guess that was a few questions but the one I really need answered is; is there another way to obtain this info or will fileinfo be able to see that every time?

Link to comment
https://forums.phpfreaks.com/topic/168357-get-true-mime-type/
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.