Topic: best way to get the mime-type from a file (Read 687 times)
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6301
38632 credits Members referred : 374
It's time to use PHP5!
« on: Aug 31, 2006, 05:01:57 PM »
Hello,
Just tried to get the mime-type for a file to use this information in my e-mail class.
First I like to use the the function mime_content_type() but this is not supoorted on all shared hosting services, another one is with help of the exif module but this also limited on some machines. To get the type for an image can be done with getimagesize(), but how to get this information for other files type (zip, doc, xls etc...)
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6301
38632 credits Members referred : 374
It's time to use PHP5!
« Reply #2 on: Aug 31, 2006, 05:17:58 PM »
Thank, you I saw this code in the manual, but I think its not possible to use for all this people with cheap (and bad) hosting services... I think it's OK to use only a "automatic" mimetypes for images and default octet-stream for attachments.
It is very time consuming and difficult to make your own function for this....
you again I know but I need only a custom class to send e-mails by my other classes clases (access_user, db_cart) there is no need to build complete e-mail applications. I think about to skip smtp functions because php mailer works fine there...