<?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 Force File Download With PHP</title>
	<atom:link href="http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/</link>
	<description>Slightly Advanced Computer Stuff (and some magic)</description>
	<lastBuildDate>Fri, 19 Mar 2010 03:52:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Joern</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-33952</link>
		<dc:creator>Joern</dc:creator>
		<pubDate>Wed, 10 Mar 2010 10:26:27 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-33952</guid>
		<description>Thanks for the fast reply.
No we are talking about files bigger than 10MB. 
Also when I&#039;m using the line &quot;@ob_end_clean();&quot; FF is telling me that he can&#039;t open the file on the server. If I comment it out its workin as explained.
Here two headers probably they help

Working one:

HTTP/1.1 200 OK
Date: Wed, 10 Mar 2010 10:19:33 GMT
Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.9
Content-Disposition: attachment; filename=&quot;v_2010-03-09_001.wma&quot;
Content-Transfer-Encoding: binary
Accept-Ranges: bytes
Cache-Control: private
Pragma: private
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 3326385
Connection: close
Content-Type: audio/x-ms-wma

Not working:

HTTP/1.1 200 OK
Date: Wed, 10 Mar 2010 10:22:03 GMT
Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.9
Content-Disposition: attachment; filename=&quot;v_2010-03-09_002.wma&quot;
Content-Transfer-Encoding: binary
Accept-Ranges: bytes
Cache-Control: private
Pragma: private
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Content-Length: 0
Connection: close
Content-Type: audio/x-ms-wma</description>
		<content:encoded><![CDATA[<p>Thanks for the fast reply.<br />
No we are talking about files bigger than 10MB.<br />
Also when I&#8217;m using the line &#8220;@ob_end_clean();&#8221; FF is telling me that he can&#8217;t open the file on the server. If I comment it out its workin as explained.<br />
Here two headers probably they help</p>
<p>Working one:</p>
<p>HTTP/1.1 200 OK<br />
Date: Wed, 10 Mar 2010 10:19:33 GMT<br />
Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635<br />
X-Powered-By: PHP/5.2.9<br />
Content-Disposition: attachment; filename=&#8221;v_2010-03-09_001.wma&#8221;<br />
Content-Transfer-Encoding: binary<br />
Accept-Ranges: bytes<br />
Cache-Control: private<br />
Pragma: private<br />
Expires: Mon, 26 Jul 1997 05:00:00 GMT<br />
Content-Encoding: gzip<br />
Vary: Accept-Encoding<br />
Content-Length: 3326385<br />
Connection: close<br />
Content-Type: audio/x-ms-wma</p>
<p>Not working:</p>
<p>HTTP/1.1 200 OK<br />
Date: Wed, 10 Mar 2010 10:22:03 GMT<br />
Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635<br />
X-Powered-By: PHP/5.2.9<br />
Content-Disposition: attachment; filename=&#8221;v_2010-03-09_002.wma&#8221;<br />
Content-Transfer-Encoding: binary<br />
Accept-Ranges: bytes<br />
Cache-Control: private<br />
Pragma: private<br />
Expires: Mon, 26 Jul 1997 05:00:00 GMT<br />
Content-Length: 0<br />
Connection: close<br />
Content-Type: audio/x-ms-wma</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-33951</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Wed, 10 Mar 2010 10:04:22 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-33951</guid>
		<description>How &quot;large&quot; are we talking about? If it&#039;s over 4 GB, it &lt;em&gt;might&lt;/em&gt; cause an integer overflow.</description>
		<content:encoded><![CDATA[<p>How &#8220;large&#8221; are we talking about? If it&#8217;s over 4 GB, it <em>might</em> cause an integer overflow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joern</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-33950</link>
		<dc:creator>Joern</dc:creator>
		<pubDate>Wed, 10 Mar 2010 09:27:26 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-33950</guid>
		<description>Hi 
Thanks for the script!
It&#039;s working fine as long as I&#039;m using it for small files, but as soon as I&#039;m trying to use it with larger files the file size in the header turns to zero and so the downloaded file has a size of zero.Anyhow when I link the file normaly and right click the link I can download the file. Do you have any suggestion why this happens?</description>
		<content:encoded><![CDATA[<p>Hi<br />
Thanks for the script!<br />
It&#8217;s working fine as long as I&#8217;m using it for small files, but as soon as I&#8217;m trying to use it with larger files the file size in the header turns to zero and so the downloaded file has a size of zero.Anyhow when I link the file normaly and right click the link I can download the file. Do you have any suggestion why this happens?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-33008</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Thu, 17 Dec 2009 17:59:59 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-33008</guid>
		<description>hehe, no time to learn php, only to make it work asap :)
i&#039;m going to ask the folks in the forums, thanks for your quick reply :)</description>
		<content:encoded><![CDATA[<p>hehe, no time to learn php, only to make it work asap <img src='http://w-shadow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
i&#8217;m going to ask the folks in the forums, thanks for your quick reply <img src='http://w-shadow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-33007</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Thu, 17 Dec 2009 17:51:15 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-33007</guid>
		<description>&lt;em&gt;Oh for the mind-tearing dread of Cthulhu...&lt;/em&gt;

I&#039;d really recommend you to learn a bit more about PHP programming before attempting this. Alternatively, you could perhaps ask the same question on one of the programming forums.</description>
		<content:encoded><![CDATA[<p><em>Oh for the mind-tearing dread of Cthulhu&#8230;</em></p>
<p>I&#8217;d really recommend you to learn a bit more about PHP programming before attempting this. Alternatively, you could perhaps ask the same question on one of the programming forums.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-33005</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Thu, 17 Dec 2009 17:40:53 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-33005</guid>
		<description>Hi, i&#039;m new to php programming, and i could use a little help with implementing this. I see that there are no open and closing  tags around this script? I also understand that i need to save this script as a .php file and call it something like filedownload.php? I need this file to handle image downloads for me and i &#039;m not really sure how to go about it? I have a WordPress website with a lot of images, in the images folder, and the images are stored in different folders, for different categories. Can i just put this script in my images folder and call it from html for each image? This is very tricky i guess?</description>
		<content:encoded><![CDATA[<p>Hi, i&#8217;m new to php programming, and i could use a little help with implementing this. I see that there are no open and closing  tags around this script? I also understand that i need to save this script as a .php file and call it something like filedownload.php? I need this file to handle image downloads for me and i &#8216;m not really sure how to go about it? I have a WordPress website with a lot of images, in the images folder, and the images are stored in different folders, for different categories. Can i just put this script in my images folder and call it from html for each image? This is very tricky i guess?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-32775</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Sat, 05 Dec 2009 21:21:33 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-32775</guid>
		<description>As I said, just add some parameters to the URL. If your script is download.php, change the URL to download.php?rand=123 or whatever. You could also investigate the &lt;a href=&quot;http://surf11.com/entry/98/prevent-caching-with-http-headers&quot; rel=&quot;nofollow&quot;&gt;Expires &amp; Cache-Control HTTP headers&lt;/a&gt;. Also, see section 14.9 of &lt;a href=&quot;http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html&quot; rel=&quot;nofollow&quot;&gt;this RFC&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>As I said, just add some parameters to the URL. If your script is download.php, change the URL to download.php?rand=123 or whatever. You could also investigate the <a href="http://surf11.com/entry/98/prevent-caching-with-http-headers" rel="nofollow">Expires &#038; Cache-Control HTTP headers</a>. Also, see section 14.9 of <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="nofollow">this RFC</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VoodooJai</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-32774</link>
		<dc:creator>VoodooJai</dc:creator>
		<pubDate>Sat, 05 Dec 2009 21:09:18 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-32774</guid>
		<description>Hi
I think your right in that caching is occuring, even if I change the download filename and save the php file it still gets the previous file.
To get a different file I have to rename the download script file and it will get the new file, but then back to the same old problem.

Frustrated
VoodooJai</description>
		<content:encoded><![CDATA[<p>Hi<br />
I think your right in that caching is occuring, even if I change the download filename and save the php file it still gets the previous file.<br />
To get a different file I have to rename the download script file and it will get the new file, but then back to the same old problem.</p>
<p>Frustrated<br />
VoodooJai</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-32766</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Sat, 05 Dec 2009 12:00:05 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-32766</guid>
		<description>It&#039;s probably Firefox caching the file. You could try varying the download URL by attaching some superfluous parameters, like &quot;&amp;rand=64564&quot; or similar.</description>
		<content:encoded><![CDATA[<p>It&#8217;s probably Firefox caching the file. You could try varying the download URL by attaching some superfluous parameters, like &#8220;&amp;rand=64564&#8243; or similar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VoodooJai</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-3/#comment-32753</link>
		<dc:creator>VoodooJai</dc:creator>
		<pubDate>Fri, 04 Dec 2009 23:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-32753</guid>
		<description>Hi again
I have tested this script locally using apache &amp; firefox and when I change the file names to download I still get the previous file not the new one.
When I upload the files and use remotely I still have  this problem with FF but all seems fine with IE8.

Any solutions !

VoodooJai</description>
		<content:encoded><![CDATA[<p>Hi again<br />
I have tested this script locally using apache &amp; firefox and when I change the file names to download I still get the previous file not the new one.<br />
When I upload the files and use remotely I still have  this problem with FF but all seems fine with IE8.</p>
<p>Any solutions !</p>
<p>VoodooJai</p>
]]></content:encoded>
	</item>
</channel>
</rss>
