<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Code The World — Simple file downloader]]></title>
		<link>https://codetheworld.com/viewtopic.php?id=75</link>
		<atom:link href="https://codetheworld.com/extern.php?action=feed&amp;tid=75&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Simple file downloader.]]></description>
		<lastBuildDate>Mon, 16 Jun 2008 07:44:34 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Simple file downloader]]></title>
			<link>https://codetheworld.com/viewtopic.php?pid=240#p240</link>
			<description><![CDATA[<p>We need some protection there.</p><p>Below </p><div class="codebox"><pre><code>if ($_SERVER[&#039;HTTP_REFERER&#039;] != &quot;http://www.funfile-world.com/&quot;) {

        header(&quot;HTTP/1.1 404 Not Found&quot;);

    }</code></pre></div><p>Add:</p><div class="codebox"><pre><code>if (strstr($_GET[&#039;file&#039;], &quot;../&quot;)) {
    die(&quot;Hacking Attempt&quot;);
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Terry)]]></author>
			<pubDate>Mon, 16 Jun 2008 07:44:34 +0000</pubDate>
			<guid>https://codetheworld.com/viewtopic.php?pid=240#p240</guid>
		</item>
		<item>
			<title><![CDATA[Simple file downloader]]></title>
			<link>https://codetheworld.com/viewtopic.php?pid=216#p216</link>
			<description><![CDATA[<div class="codebox"><pre><code>    if ($_SERVER[&#039;HTTP_REFERER&#039;] != &quot;http://www.funfile-world.com/&quot;) {

        header(&quot;HTTP/1.1 404 Not Found&quot;);

    }

        $dir=&quot;/path/to/your/file/directory/&quot;;
        $filename = $dir.$_GET[&#039;file&#039;];

    if (isset($_REQUEST[&#039;file&#039;]) &amp;&amp; file_exists($filename) ) {

        header(&quot;HTTP/1.1 200 OK&quot;);
        header(&quot;Status: 200 OK&quot;);
        header(&#039;Pragma: private&#039;);
        header(&#039;Cache-control: private, must-revalidate&#039;);
        header(&#039;Content-type: application/force-download&#039;);
        header( &quot;Content-Disposition: attachment; filename=&quot;.basename($filename));
        header(&#039;Content-Length: &#039; . filesize($filename));
        header( &quot;Content-Description: File Transfer&quot;);
        readfile($filename);
    } else {
        echo &#039;No file with this name for download.&#039;;
    }</code></pre></div><p>you can add more function to have more control of your downloader... <img src="https://codetheworld.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (a3d2i2)]]></author>
			<pubDate>Mon, 16 Jun 2008 04:06:19 +0000</pubDate>
			<guid>https://codetheworld.com/viewtopic.php?pid=216#p216</guid>
		</item>
	</channel>
</rss>
