Topic: best way to get the mime-type from a file (Read 1681 times)
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« on: Aug 31, 2006, 04: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...)
who knows a diff. way?
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #1 on: Aug 31, 2006, 04:10:55 pm »
I guess system() wont work on shared hosting either, but you can check this :
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #2 on: Aug 31, 2006, 04: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.
In phpmailer you have to define all mime types...
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #3 on: Aug 31, 2006, 04:20:22 pm »
It is very time consuming and difficult to make your own function for this....
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...
(at the end i'm almost ready...)
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=3913