<?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: How to restrict image access to logged in users with PHP and .htaccess</title>
	<atom:link href="http://stuporglue.org/how-to-restrict-image-access-to-logged-in-users-with-php-and-htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuporglue.org/how-to-restrict-image-access-to-logged-in-users-with-php-and-htaccess/</link>
	<description>Programming, Rambling and More!</description>
	<lastBuildDate>Wed, 16 May 2012 19:41:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: stuporglue</title>
		<link>http://stuporglue.org/how-to-restrict-image-access-to-logged-in-users-with-php-and-htaccess/comment-page-1/#comment-1080</link>
		<dc:creator>stuporglue</dc:creator>
		<pubDate>Thu, 03 May 2012 16:50:06 +0000</pubDate>
		<guid isPermaLink="false">http://stuporglue.org/?p=37#comment-1080</guid>
		<description>To send any type of file as a download you just need to set the mime type. That&#039;s the &quot;Content-type&quot; header.

header(&quot;Content-type: image/jpeg&quot;);

You can detect the mime type dynamically with either 

http://www.php.net/manual/en/function.mime-content-type.php (PHP &lt; 5.3) 
or
http://www.php.net/manual/en/function.finfo-file.php (PHP &gt;= 5.3)

If you&#039;re doing just pdf&#039;s, the mime type is &quot;application/pdf&quot;. 


If you want a download progress bar to appear you can also send the Content-Length header, otherwise browsers will show &quot;Downloading .2MB of ???&quot; etc.

$fsize = filesize($filepath); 
header(&quot;Content-Length: &quot;.$fsize);</description>
		<content:encoded><![CDATA[<p>To send any type of file as a download you just need to set the mime type. That&#8217;s the &#8220;Content-type&#8221; header.</p>
<p>header(&#8220;Content-type: image/jpeg&#8221;);</p>
<p>You can detect the mime type dynamically with either </p>
<p><a href="http://www.php.net/manual/en/function.mime-content-type.php" rel="nofollow">http://www.php.net/manual/en/function.mime-content-type.php</a> (PHP < 5.3)<br />
or<br />
http://www.php.net/manual/en/function.finfo-file.php (PHP >= 5.3)</p>
<p>If you&#8217;re doing just pdf&#8217;s, the mime type is &#8220;application/pdf&#8221;. </p>
<p>If you want a download progress bar to appear you can also send the Content-Length header, otherwise browsers will show &#8220;Downloading .2MB of ???&#8221; etc.</p>
<p>$fsize = filesize($filepath);<br />
header(&#8220;Content-Length: &#8220;.$fsize);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruatas</title>
		<link>http://stuporglue.org/how-to-restrict-image-access-to-logged-in-users-with-php-and-htaccess/comment-page-1/#comment-1078</link>
		<dc:creator>Ruatas</dc:creator>
		<pubDate>Thu, 03 May 2012 10:08:14 +0000</pubDate>
		<guid isPermaLink="false">http://stuporglue.org/?p=37#comment-1078</guid>
		<description>How about PDF files? or any other kind of documents?</description>
		<content:encoded><![CDATA[<p>How about PDF files? or any other kind of documents?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stuporglue</title>
		<link>http://stuporglue.org/how-to-restrict-image-access-to-logged-in-users-with-php-and-htaccess/comment-page-1/#comment-670</link>
		<dc:creator>stuporglue</dc:creator>
		<pubDate>Wed, 29 Jun 2011 07:47:13 +0000</pubDate>
		<guid isPermaLink="false">http://stuporglue.org/?p=37#comment-670</guid>
		<description>I&#039;m glad you found it!</description>
		<content:encoded><![CDATA[<p>I&#8217;m glad you found it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francisco</title>
		<link>http://stuporglue.org/how-to-restrict-image-access-to-logged-in-users-with-php-and-htaccess/comment-page-1/#comment-669</link>
		<dc:creator>Francisco</dc:creator>
		<pubDate>Wed, 29 Jun 2011 04:28:30 +0000</pubDate>
		<guid isPermaLink="false">http://stuporglue.org/?p=37#comment-669</guid>
		<description>Thank you so much! You saved me with this wonderful idea of using mod_rewrite for access control. 

I just wish this method was more often discussed in on forums (took me hours to get here). I will sure point some people to this page.</description>
		<content:encoded><![CDATA[<p>Thank you so much! You saved me with this wonderful idea of using mod_rewrite for access control. </p>
<p>I just wish this method was more often discussed in on forums (took me hours to get here). I will sure point some people to this page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stuporglue</title>
		<link>http://stuporglue.org/how-to-restrict-image-access-to-logged-in-users-with-php-and-htaccess/comment-page-1/#comment-392</link>
		<dc:creator>stuporglue</dc:creator>
		<pubDate>Fri, 10 Sep 2010 21:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://stuporglue.org/?p=37#comment-392</guid>
		<description>Fantastic! I&#039;m glad it helped!</description>
		<content:encoded><![CDATA[<p>Fantastic! I&#8217;m glad it helped!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JasonSaeho</title>
		<link>http://stuporglue.org/how-to-restrict-image-access-to-logged-in-users-with-php-and-htaccess/comment-page-1/#comment-391</link>
		<dc:creator>JasonSaeho</dc:creator>
		<pubDate>Fri, 10 Sep 2010 21:11:05 +0000</pubDate>
		<guid isPermaLink="false">http://stuporglue.org/?p=37#comment-391</guid>
		<description>Thank you for this post, it helped me with an application I was making.</description>
		<content:encoded><![CDATA[<p>Thank you for this post, it helped me with an application I was making.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

