<?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>A blog about web development, software business, and WordPress</description>
	<lastBuildDate>Wed, 22 May 2013 11:48:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Jānis Elsts</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-6/#comment-242565</link>
		<dc:creator>Jānis Elsts</dc:creator>
		<pubDate>Mon, 04 Mar 2013 06:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-242565</guid>
		<description><![CDATA[Your code looks fine to me. Maybe you could try watching the download with a HTTP debugger like &lt;a href=&quot;http://www.fiddler2.com/fiddler2/&quot; rel=&quot;nofollow&quot;&gt;Fiddler&lt;/a&gt; to see if there&#039;s anything wrong with it.]]></description>
		<content:encoded><![CDATA[<p>Your code looks fine to me. Maybe you could try watching the download with a HTTP debugger like <a href="http://www.fiddler2.com/fiddler2/" rel="nofollow">Fiddler</a> to see if there&#8217;s anything wrong with it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scotty</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-6/#comment-242494</link>
		<dc:creator>Scotty</dc:creator>
		<pubDate>Mon, 04 Mar 2013 03:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-242494</guid>
		<description><![CDATA[Am trying to use this as it is entirely. Just modified the example use code to suit my needs like so

set_time_limit(0);
$file_path=&#039;assets/mici_blossom.pdf&#039;;
output_file($file_path, &#039;mici_blossom.pdf&#039;, &#039;application/pdf&#039;);

Keep getting this error.
C:\DOCUME~1\Scott\LOCALS~1\Temp\+6U2ePvN.pdf.part could not be saved, because the source file could not be read.

Try again later, or contact the server administrator.

The file is there and named correctly. It is a 25mb pdf. Can anyone tell me why? Or what am I missing?
Thanks
Scott]]></description>
		<content:encoded><![CDATA[<p>Am trying to use this as it is entirely. Just modified the example use code to suit my needs like so</p>
<p>set_time_limit(0);<br />
$file_path=&#8217;assets/mici_blossom.pdf&#8217;;<br />
output_file($file_path, &#8216;mici_blossom.pdf&#8217;, &#8216;application/pdf&#8217;);</p>
<p>Keep getting this error.<br />
C:\DOCUME~1\Scott\LOCALS~1\Temp\+6U2ePvN.pdf.part could not be saved, because the source file could not be read.</p>
<p>Try again later, or contact the server administrator.</p>
<p>The file is there and named correctly. It is a 25mb pdf. Can anyone tell me why? Or what am I missing?<br />
Thanks<br />
Scott</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: twakspot</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-6/#comment-233928</link>
		<dc:creator>twakspot</dc:creator>
		<pubDate>Sat, 09 Feb 2013 18:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-233928</guid>
		<description><![CDATA[after trying the 11th script without success, finally found this and how sweet it is! thank you so much. this is SOLID! all browsers happy.]]></description>
		<content:encoded><![CDATA[<p>after trying the 11th script without success, finally found this and how sweet it is! thank you so much. this is SOLID! all browsers happy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hariharan</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-6/#comment-201771</link>
		<dc:creator>hariharan</dc:creator>
		<pubDate>Wed, 25 Jul 2012 17:08:35 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-201771</guid>
		<description><![CDATA[Really Great ... I have been searching nearly for a day  to use ob_start with  file download.. either one works but not both. At Last I found it from you to use @ob_end_clean() .. Which solved my problem....

Thanks once again....]]></description>
		<content:encoded><![CDATA[<p>Really Great &#8230; I have been searching nearly for a day  to use ob_start with  file download.. either one works but not both. At Last I found it from you to use @ob_end_clean() .. Which solved my problem&#8230;.</p>
<p>Thanks once again&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dev &#124; Pearltrees</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-6/#comment-199619</link>
		<dc:creator>Dev &#124; Pearltrees</dc:creator>
		<pubDate>Tue, 17 Apr 2012 18:13:44 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-199619</guid>
		<description><![CDATA[[...] header( &#039;Pragma: private&#039; ); header( &quot;Expires: Mon, 26 Jul 1997 05:00:00 GMT&quot; ); header( &quot;Cache-control: private&quot; );  How To Force File Download With PHP &#124; W-Shadow.com [...]]]></description>
		<content:encoded><![CDATA[<p>[...] header( &#039;Pragma: private&#039; ); header( &quot;Expires: Mon, 26 Jul 1997 05:00:00 GMT&quot; ); header( &quot;Cache-control: private&quot; );  How To Force File Download With PHP | W-Shadow.com [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Web tools &#124; Pearltrees</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-6/#comment-198936</link>
		<dc:creator>Web tools &#124; Pearltrees</dc:creator>
		<pubDate>Tue, 20 Mar 2012 21:40:53 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-198936</guid>
		<description><![CDATA[[...] How To Force File Download With PHP &#124; W-Shadow.com header( &#039;Pragma: private&#039; ); [...]]]></description>
		<content:encoded><![CDATA[<p>[...] How To Force File Download With PHP | W-Shadow.com header( &#039;Pragma: private&#039; ); [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: just another addict</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-5/#comment-198307</link>
		<dc:creator>just another addict</dc:creator>
		<pubDate>Thu, 23 Feb 2012 19:43:56 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-198307</guid>
		<description><![CDATA[Thanks very much for this. You are a genius!!!]]></description>
		<content:encoded><![CDATA[<p>Thanks very much for this. You are a genius!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: swellendam accommodation</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-5/#comment-180174</link>
		<dc:creator>swellendam accommodation</dc:creator>
		<pubDate>Mon, 19 Sep 2011 16:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-180174</guid>
		<description><![CDATA[&lt;strong&gt;swellendam accommodation...&lt;/strong&gt;

[...]How To Force File Download With PHP &#124; W-Shadow.com[...]...]]></description>
		<content:encoded><![CDATA[<p><strong>swellendam accommodation&#8230;</strong></p>
<p>[...]How To Force File Download With PHP | W-Shadow.com[...]&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WuFe</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-5/#comment-176005</link>
		<dc:creator>WuFe</dc:creator>
		<pubDate>Tue, 06 Sep 2011 17:12:23 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-176005</guid>
		<description><![CDATA[Goosy, the cURL method to retrieve the file size doesn&#039;t work ever.
The best function to retrieve the size of a remote file is this:

function remotefilesize( $url ){
    $size = get_headers( $url, 1 );
    $size = $size[ &quot;Content-Length&quot; ];
    return $size;
}

Anyway thanks a lot for the snippet..]]></description>
		<content:encoded><![CDATA[<p>Goosy, the cURL method to retrieve the file size doesn&#8217;t work ever.<br />
The best function to retrieve the size of a remote file is this:</p>
<p>function remotefilesize( $url ){<br />
    $size = get_headers( $url, 1 );<br />
    $size = $size[ "Content-Length" ];<br />
    return $size;<br />
}</p>
<p>Anyway thanks a lot for the snippet..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: goosy</title>
		<link>http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/comment-page-5/#comment-173157</link>
		<dc:creator>goosy</dc:creator>
		<pubDate>Tue, 23 Aug 2011 08:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/08/12/how-to-force-file-download-with-php/#comment-173157</guid>
		<description><![CDATA[Thanks a lot !!! Just more things for force download on cross -domain 
delte this line &quot;if(!is_readable($file)) die(&#039;File not found or inaccessible!&#039;);&quot; and for the file size use curl method like above 
// Create a curl connection
$chGetSize = curl_init();
 
// Set the url we&#039;re requesting
curl_setopt($chGetSize, CURLOPT_URL, &quot;http://www.example.com/file.exe&quot;);
 
// Set a valid user agent
curl_setopt($chGetSize, CURLOPT_USERAGENT, &quot;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11&quot;);
 
// Don&#039;t output any response directly to the browser
curl_setopt($chGetSize, CURLOPT_RETURNTRANSFER, true);
 
// Don&#039;t return the header (we&#039;ll use curl_getinfo();
curl_setopt($chGetSize, CURLOPT_HEADER, false);
 
// Don&#039;t download the body content
curl_setopt($chGetSize, CURLOPT_NOBODY, true);
 
// Run the curl functions to process the request
$chGetSizeStore = curl_exec($chGetSize);
$chGetSizeError = curl_error($chGetSize);
$chGetSizeInfo = curl_getinfo($chGetSize);
 
// Close the connection
curl_close($chGetSize);// Print the file size in bytes
 
$size=$chGetSizeInfo[&#039;download_content_length&#039;];

thx again !]]></description>
		<content:encoded><![CDATA[<p>Thanks a lot !!! Just more things for force download on cross -domain<br />
delte this line &#8220;if(!is_readable($file)) die(&#8216;File not found or inaccessible!&#8217;);&#8221; and for the file size use curl method like above<br />
// Create a curl connection<br />
$chGetSize = curl_init();</p>
<p>// Set the url we&#8217;re requesting<br />
curl_setopt($chGetSize, CURLOPT_URL, &#8220;http://www.example.com/file.exe&#8221;);</p>
<p>// Set a valid user agent<br />
curl_setopt($chGetSize, CURLOPT_USERAGENT, &#8220;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11&#8243;);</p>
<p>// Don&#8217;t output any response directly to the browser<br />
curl_setopt($chGetSize, CURLOPT_RETURNTRANSFER, true);</p>
<p>// Don&#8217;t return the header (we&#8217;ll use curl_getinfo();<br />
curl_setopt($chGetSize, CURLOPT_HEADER, false);</p>
<p>// Don&#8217;t download the body content<br />
curl_setopt($chGetSize, CURLOPT_NOBODY, true);</p>
<p>// Run the curl functions to process the request<br />
$chGetSizeStore = curl_exec($chGetSize);<br />
$chGetSizeError = curl_error($chGetSize);<br />
$chGetSizeInfo = curl_getinfo($chGetSize);</p>
<p>// Close the connection<br />
curl_close($chGetSize);// Print the file size in bytes</p>
<p>$size=$chGetSizeInfo['download_content_length'];</p>
<p>thx again !</p>
]]></content:encoded>
	</item>
</channel>
</rss>
