YourNameHere Posted August 1, 2009 Share Posted August 1, 2009 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 More sharing options...
corbin Posted August 1, 2009 Share Posted August 1, 2009 " that will accept .doc and .docx files and save them to a directory on the server for later download. " Why not just check the file extension? Link to comment https://forums.phpfreaks.com/topic/168357-get-true-mime-type/#findComment-888109 Share on other sites More sharing options...
YourNameHere Posted August 1, 2009 Author Share Posted August 1, 2009 Whay not? You ask? That would be WAY too under-complicated. I was just overthinking it. Thanks Link to comment https://forums.phpfreaks.com/topic/168357-get-true-mime-type/#findComment-888114 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.