<?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 I PHP: X-SendFile</title>
	<atom:link href="http://www.jasny.net/articles/how-i-php-x-sendfile/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jasny.net/articles/how-i-php-x-sendfile/</link>
	<description>Helping you out with PHP &#38; MySQL</description>
	<lastBuildDate>Wed, 25 Jan 2012 21:57:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Arnold Daniels</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-336943</link>
		<dc:creator>Arnold Daniels</dc:creator>
		<pubDate>Wed, 02 Mar 2011 12:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-336943</guid>
		<description>That could work. You don&#039;t need to do database pairing, just create a random filename, symlink and redirect to that.

However I don&#039;t see why you would prefer that &#039;poor-man&#039; solution above x-senfile.</description>
		<content:encoded><![CDATA[<p>That could work. You don&#8217;t need to do database pairing, just create a random filename, symlink and redirect to that.</p>
<p>However I don&#8217;t see why you would prefer that &#8216;poor-man&#8217; solution above x-senfile.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sima Kosmos</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-336942</link>
		<dc:creator>Sima Kosmos</dc:creator>
		<pubDate>Wed, 02 Mar 2011 00:39:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-336942</guid>
		<description>Has anyone tried something like this? More of apache conf/tweaking approach but, feel free to criticize 

1.Create symlink to physical file including some hash of session id in symlink name or do database pairing of symlink-physical_file-session
2.Redirect to that symlink (was that Options FollowSymLinks? in conf)
3.Cron does removal of symbolic links that are not named like present sessions/database keys from time to time or the ones older than max_download_availability. 

Maybe do calc of clients average download speed to estimate max download time, and schedule deletion.

The only question is what will apache send as file name? Symlink name or the physical file name? The second being preferable :)

It is security by obscurity! But would it work?</description>
		<content:encoded><![CDATA[<p>Has anyone tried something like this? More of apache conf/tweaking approach but, feel free to criticize </p>
<p>1.Create symlink to physical file including some hash of session id in symlink name or do database pairing of symlink-physical_file-session<br />
2.Redirect to that symlink (was that Options FollowSymLinks? in conf)<br />
3.Cron does removal of symbolic links that are not named like present sessions/database keys from time to time or the ones older than max_download_availability. </p>
<p>Maybe do calc of clients average download speed to estimate max download time, and schedule deletion.</p>
<p>The only question is what will apache send as file name? Symlink name or the physical file name? The second being preferable <img src='http://www.jasny.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It is security by obscurity! But would it work?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arnold Daniels</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-336920</link>
		<dc:creator>Arnold Daniels</dc:creator>
		<pubDate>Sun, 09 Jan 2011 14:36:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-336920</guid>
		<description>You&#039;re PHP framework is probably adding that. On top of you file add &lt;b&gt;ob_start();&lt;/b&gt;. Than before $fd=.. add &lt;b&gt;ob_end_clean();&lt;/b&gt;.

I also advise to use x-sendfile instead of readfile(), if your webhost supports it.</description>
		<content:encoded><![CDATA[<p>You&#8217;re PHP framework is probably adding that. On top of you file add <b>ob_start();</b>. Than before $fd=.. add <b>ob_end_clean();</b>.</p>
<p>I also advise to use x-sendfile instead of readfile(), if your webhost supports it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Moe</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-336914</link>
		<dc:creator>Moe</dc:creator>
		<pubDate>Sat, 08 Jan 2011 21:21:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-336914</guid>
		<description>Hello,

The code below works on my localhost to download a file. However, on top of my downloaded file there are 160 lines of HTML tags. How can I eliminate these tags and just get the plain file?
I appreciate your advice.

$fd = basename($csv);		
header(&quot;Content-type: application/octet-stream&quot;); 
header(&quot;Content-Disposition: attachment; filename=\&quot;&quot;.$fd.&quot;\&quot;&quot;); 
header(&quot;Content-Description: Download&quot;);	
readfile($csv);</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>The code below works on my localhost to download a file. However, on top of my downloaded file there are 160 lines of HTML tags. How can I eliminate these tags and just get the plain file?<br />
I appreciate your advice.</p>
<p>$fd = basename($csv);<br />
header(&#8220;Content-type: application/octet-stream&#8221;);<br />
header(&#8220;Content-Disposition: attachment; filename=\&#8221;".$fd.&#8221;\&#8221;");<br />
header(&#8220;Content-Description: Download&#8221;);<br />
readfile($csv);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-209625</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Fri, 30 Oct 2009 17:47:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-209625</guid>
		<description>so one of the downfalls i&#039;ve found with this method is that, unlike with the stock PHP header methods, when you have more code after the xsend file code, it doesn&#039;t wait until the filesend is done before executing the code... with the first example it waits until the filesend is done, but not with xsend. this is particularly useful if you need to log the fact that the user had a successful download. if the download failed then the code below the download would just not execute, so the user could download again.

what i&#039;m getting at-- is there a way around this with xsendfile? i&#039;m looking for a way to mark that a user has successfully downloaded  a complete file in the database, so they can&#039;t download again. as of now using the same code with the xsendfile modifications, it just always marks the file download as successful because of this.</description>
		<content:encoded><![CDATA[<p>so one of the downfalls i&#8217;ve found with this method is that, unlike with the stock PHP header methods, when you have more code after the xsend file code, it doesn&#8217;t wait until the filesend is done before executing the code&#8230; with the first example it waits until the filesend is done, but not with xsend. this is particularly useful if you need to log the fact that the user had a successful download. if the download failed then the code below the download would just not execute, so the user could download again.</p>
<p>what i&#8217;m getting at&#8211; is there a way around this with xsendfile? i&#8217;m looking for a way to mark that a user has successfully downloaded  a complete file in the database, so they can&#8217;t download again. as of now using the same code with the xsendfile modifications, it just always marks the file download as successful because of this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fran</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-199519</link>
		<dc:creator>Fran</dc:creator>
		<pubDate>Tue, 16 Jun 2009 16:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-199519</guid>
		<description>downloads got stalled at getting file information at least with IE6.0 (not tested with other IE releases)

suggested hack : Cache-Control: must-revalidate doesn&#039;t work, 

any help?

thanks</description>
		<content:encoded><![CDATA[<p>downloads got stalled at getting file information at least with IE6.0 (not tested with other IE releases)</p>
<p>suggested hack : Cache-Control: must-revalidate doesn&#8217;t work, </p>
<p>any help?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arnold Daniels</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-195783</link>
		<dc:creator>Arnold Daniels</dc:creator>
		<pubDate>Sat, 30 May 2009 14:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-195783</guid>
		<description>On http://packages.ubuntu.com you can find which package to install for a specific executable or other file.

http://packages.ubuntu.com/search?searchon=contents&amp;keywords=apxs2&amp;mode=exactfilename&amp;suite=jaunty&amp;arch=any

If you&#039;re running PHP as module, install &#039;apache2-prefork-dev&#039;.</description>
		<content:encoded><![CDATA[<p>On <a href="http://packages.ubuntu.com" rel="nofollow">http://packages.ubuntu.com</a> you can find which package to install for a specific executable or other file.</p>
<p><a href="http://packages.ubuntu.com/search?searchon=contents&#038;keywords=apxs2&#038;mode=exactfilename&#038;suite=jaunty&#038;arch=any" rel="nofollow">http://packages.ubuntu.com/search?searchon=contents&#038;keywords=apxs2&#038;mode=exactfilename&#038;suite=jaunty&#038;arch=any</a></p>
<p>If you&#8217;re running PHP as module, install &#8216;apache2-prefork-dev&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TopFX</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-195338</link>
		<dc:creator>TopFX</dc:creator>
		<pubDate>Fri, 29 May 2009 13:42:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-195338</guid>
		<description>I&#039;m also trying to get this to work but cannot get it to install on an Ubuntu Plesk server, it fails to compile.

The server is running Apache2, but if you do a locate search it only finds apxs and not apxs2 as pharrington suggests it should.

I really need to get this working so any ideas would really be appreciated</description>
		<content:encoded><![CDATA[<p>I&#8217;m also trying to get this to work but cannot get it to install on an Ubuntu Plesk server, it fails to compile.</p>
<p>The server is running Apache2, but if you do a locate search it only finds apxs and not apxs2 as pharrington suggests it should.</p>
<p>I really need to get this working so any ideas would really be appreciated</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pharrington</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-174661</link>
		<dc:creator>pharrington</dc:creator>
		<pubDate>Fri, 01 May 2009 22:49:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-174661</guid>
		<description>Xorax:

what errors did you get when trying to install? remember that with apache2, the program to compile modules is

apxs2

instead of 

apxs

also, if for whatever reason you need to manually create the config file (eg Ubuntu), the LoadModule line is:

LoadModule xsendfile_module /usr/lib/apache2/modules/mod_xsendfile.so (substitute for the correct path if necessary)</description>
		<content:encoded><![CDATA[<p>Xorax:</p>
<p>what errors did you get when trying to install? remember that with apache2, the program to compile modules is</p>
<p>apxs2</p>
<p>instead of </p>
<p>apxs</p>
<p>also, if for whatever reason you need to manually create the config file (eg Ubuntu), the LoadModule line is:</p>
<p>LoadModule xsendfile_module /usr/lib/apache2/modules/mod_xsendfile.so (substitute for the correct path if necessary)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xorax</title>
		<link>http://www.jasny.net/articles/how-i-php-x-sendfile/comment-page-1/#comment-156418</link>
		<dc:creator>Xorax</dc:creator>
		<pubDate>Thu, 16 Apr 2009 14:55:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/articles/how-i-php-x-sendfile/#comment-156418</guid>
		<description>does someone has compiled this mod for apache 2.2 ?

I tried but I have bad errors....</description>
		<content:encoded><![CDATA[<p>does someone has compiled this mod for apache 2.2 ?</p>
<p>I tried but I have bad errors&#8230;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
