Email Handling and Manipulation Question 14

15 views
Skip to first unread message

Dan Kelly

unread,
Jul 19, 2011, 1:20:05 PM7/19/11
to Zend Certification Study Group
Which of the following is the best way to determine the content type
of a file that you want
to embed in a MIME/multipart e-mail?


A. By hardcoding it in your script
B. By creating a manual list of MIME types and selecting from it based
on the file’s
extension
C. By writing a stochastic function capable of determining the file’s
data type based on
its contents
D. By using the mime_content_type function
E. By uploading the file to an external web service.

Seal Trip

unread,
Jul 19, 2011, 7:12:23 PM7/19/11
to zend-certificat...@googlegroups.com
I would of said fileinfo

Alex Stetsenko

unread,
Jul 20, 2011, 2:33:07 PM7/20/11
to zend-certificat...@googlegroups.com
Seal, I am guessing you were referring to finfo_file().
It's not listed as possible answer but I agree it should be a correct one since it was introduced exactly in PHP 5.3 and made mime_content_type() deprecated.

Still perhaps expected answer is D.

Seal Trip

unread,
Jul 20, 2011, 2:35:29 PM7/20/11
to zend-certificat...@googlegroups.com
Advance email is one of those areas I need to explore further. It actually my target on Friday to get up to speed with it.

Dan Kelly

unread,
Jul 22, 2011, 8:31:01 AM7/22/11
to Zend Certification Study Group
The mime_content_type function is the easiest and safest way to
determine the MIME type of a
file. Answer D is, therefore, correct. Note that this function is part
of a deprecated
extension—but there’s still a fair chance you’ll find it in legacy
code.
Reply all
Reply to author
Forward
0 new messages