<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Smart File Type Detection Using PHP</title>
	<atom:link href="http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/feed" rel="self" type="application/rss+xml" />
	<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/</link>
	<description>Inspiration, CSS Gallery &#38; Community News</description>
	<lastBuildDate>Fri, 10 Feb 2012 06:24:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Radiation</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-35015</link>
		<dc:creator>Radiation</dc:creator>
		<pubDate>Mon, 19 Sep 2011 13:43:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-35015</guid>
		<description>Bah! Don&#039;t use getimagesize() to validate images! It is very easy to get php code through getimagesize(). The best way to ensure that images are safe is to place them in a directory that doesn&#039;t have executable permissions. And don&#039;t ever! include() them.</description>
		<content:encoded><![CDATA[<p>Bah! Don&#8217;t use getimagesize() to validate images! It is very easy to get php code through getimagesize(). The best way to ensure that images are safe is to place them in a directory that doesn&#8217;t have executable permissions. And don&#8217;t ever! include() them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 荒野无灯</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-32688</link>
		<dc:creator>荒野无灯</dc:creator>
		<pubDate>Mon, 01 Aug 2011 11:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-32688</guid>
		<description>GOOD article ,I&#039;ve translated it on my blog:http://ihacklog.com/?p=4693</description>
		<content:encoded><![CDATA[<p>GOOD article ,I&#8217;ve translated it on my blog:<a href="http://ihacklog.com/?p=4693" rel="nofollow">http://ihacklog.com/?p=4693</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jump</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-29777</link>
		<dc:creator>Jump</dc:creator>
		<pubDate>Fri, 10 Jun 2011 16:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-29777</guid>
		<description>Love the OOP way of finding the mime, never used that before.  Cheers!</description>
		<content:encoded><![CDATA[<p>Love the OOP way of finding the mime, never used that before.  Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dejan</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-29320</link>
		<dc:creator>Dejan</dc:creator>
		<pubDate>Mon, 30 May 2011 17:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-29320</guid>
		<description>Hi

Nice tutorial.
I wonder, if possible, to post the code regarding magic bytes for mp3, since I&#039;m facing the same problem.
I can see from one of the links in your post that the magic number for mp3 is &#039;49 44 33&#039;, but still want to know if this is a reliable way to get the mime type.

Regards</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Nice tutorial.<br />
I wonder, if possible, to post the code regarding magic bytes for mp3, since I&#8217;m facing the same problem.<br />
I can see from one of the links in your post that the magic number for mp3 is &#8217;49 44 33&#8242;, but still want to know if this is a reliable way to get the mime type.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Destrey</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-28958</link>
		<dc:creator>Destrey</dc:creator>
		<pubDate>Sun, 22 May 2011 09:22:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-28958</guid>
		<description>That&#039;s 2 cveler by half and 2x2 clever 4 me. Thanks!</description>
		<content:encoded><![CDATA[<p>That&#8217;s 2 cveler by half and 2&#215;2 clever 4 me. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: milly</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-12805</link>
		<dc:creator>milly</dc:creator>
		<pubDate>Mon, 13 Dec 2010 20:18:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-12805</guid>
		<description>Thank you SO much for this.  I&#039;ve been messing with mime_content_type() and a bunch of other finicky methods, but this worked perfectly. Just what I needed.</description>
		<content:encoded><![CDATA[<p>Thank you SO much for this.  I&#8217;ve been messing with mime_content_type() and a bunch of other finicky methods, but this worked perfectly. Just what I needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aris</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-10636</link>
		<dc:creator>aris</dc:creator>
		<pubDate>Wed, 01 Dec 2010 06:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-10636</guid>
		<description>same problem with brandon. 
Where can we find this fininfo class and include it?</description>
		<content:encoded><![CDATA[<p>same problem with brandon.<br />
Where can we find this fininfo class and include it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brandon</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-10197</link>
		<dc:creator>brandon</dc:creator>
		<pubDate>Wed, 10 Nov 2010 01:15:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-10197</guid>
		<description>failed:

file_info = new finfo(FILEINFO_MIME);	// object oriented approach!
$mime_type = $file_info-&gt;buffer(file_get_contents($file));

yeilds:

Fatal error: Class &#039;finfo&#039; not found</description>
		<content:encoded><![CDATA[<p>failed:</p>
<p>file_info = new finfo(FILEINFO_MIME);	// object oriented approach!<br />
$mime_type = $file_info-&gt;buffer(file_get_contents($file));</p>
<p>yeilds:</p>
<p>Fatal error: Class &#8216;finfo&#8217; not found</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pointer Men's Basketball</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-10002</link>
		<dc:creator>Pointer Men's Basketball</dc:creator>
		<pubDate>Sat, 30 Oct 2010 07:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-10002</guid>
		<description>You you should change the page name Smart File Type Detection Using PHP &#124;  Design Shack to  more better for your content you write. I loved the the writing all the same.</description>
		<content:encoded><![CDATA[<p>You you should change the page name Smart File Type Detection Using PHP |  Design Shack to  more better for your content you write. I loved the the writing all the same.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alejandro</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-6397</link>
		<dc:creator>Alejandro</dc:creator>
		<pubDate>Tue, 25 May 2010 08:19:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-6397</guid>
		<description>mime_type returns 

&quot;application/pdf; charset=binary&quot;

so the comparison won&#039;t work.

how can I fix this?</description>
		<content:encoded><![CDATA[<p>mime_type returns </p>
<p>&#8220;application/pdf; charset=binary&#8221;</p>
<p>so the comparison won&#8217;t work.</p>
<p>how can I fix this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Only coach handbags</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-6129</link>
		<dc:creator>Only coach handbags</dc:creator>
		<pubDate>Tue, 11 May 2010 10:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-6129</guid>
		<description>Thank You, &lt;a href=&quot;http://boards.sonypictures.com/boards/member.php?u=79902&quot; rel=&quot;nofollow&quot;&gt;Only coach handbags&lt;/a&gt;, [url= http://boards.sonypictures.com/boards/member.php?u=79902 ]Only coach handbags[/url],  ouqfqx,</description>
		<content:encoded><![CDATA[<p>Thank You, <a href="http://boards.sonypictures.com/boards/member.php?u=79902" rel="nofollow">Only coach handbags</a>, [url= <a href="http://boards.sonypictures.com/boards/member.php?u=79902" rel="nofollow">http://boards.sonypictures.com/boards/member.php?u=79902</a> ]Only coach handbags[/url],  ouqfqx,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Itay</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-1675</link>
		<dc:creator>Itay</dc:creator>
		<pubDate>Sun, 22 Nov 2009 16:31:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-1675</guid>
		<description>Great post, just what I was looking for regarding file types.

Thanks.</description>
		<content:encoded><![CDATA[<p>Great post, just what I was looking for regarding file types.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kishore Nallan</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-886</link>
		<dc:creator>Kishore Nallan</dc:creator>
		<pubDate>Sat, 21 Mar 2009 13:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-886</guid>
		<description>@Alex: Thanks for that, typo fixed!</description>
		<content:encoded><![CDATA[<p>@Alex: Thanks for that, typo fixed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-831</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 10 Mar 2009 14:30:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-831</guid>
		<description>Not sure if this is typo or not (not the most knowledgeable w/ PHP), but...

$tmpFile =  $_FILES[&#039;myFile&#039;][&#039;tmp_name&#039;];  // path of the temp file created by PHP during upload
$imginfo_array = getimagesize($tempFile);   // returns a false if not a valid image file

getimagesize uses &quot;tempFile&quot; as its argument, while &quot;tmpFile&quot; was initialized above.  Shouldn&#039;t getimagesize use &quot;tmpFile&quot;?</description>
		<content:encoded><![CDATA[<p>Not sure if this is typo or not (not the most knowledgeable w/ PHP), but&#8230;</p>
<p>$tmpFile =  $_FILES['myFile']['tmp_name'];  // path of the temp file created by PHP during upload<br />
$imginfo_array = getimagesize($tempFile);   // returns a false if not a valid image file</p>
<p>getimagesize uses &#8220;tempFile&#8221; as its argument, while &#8220;tmpFile&#8221; was initialized above.  Shouldn&#8217;t getimagesize use &#8220;tmpFile&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Developer</title>
		<link>http://designshack.net/articles/php-articles/smart-file-type-detection-using-php/#comment-739</link>
		<dc:creator>Developer</dc:creator>
		<pubDate>Mon, 02 Mar 2009 05:59:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.designshack.co.uk/?p=689#comment-739</guid>
		<description>Really nice article..
It shows the depth of the knowledge.. 

Thanks a lot</description>
		<content:encoded><![CDATA[<p>Really nice article..<br />
It shows the depth of the knowledge.. </p>
<p>Thanks a lot</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 377/383 objects using disk: basic

Served from: designshack.net @ 2012-02-10 06:37:23 -->
