<?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: Protecting a download using a unique URL</title>
	<atom:link href="http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/</link>
	<description>Ardamis is a blog about web development and technology in general.</description>
	<lastBuildDate>Fri, 03 Feb 2012 03:06:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Stephen</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-50430</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Wed, 16 Mar 2011 11:16:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-50430</guid>
		<description>Great script, thanks so much. 

Has anyone managed to integrate this with Paypal yet so the user gets their code right away?</description>
		<content:encoded><![CDATA[<p>Great script, thanks so much. </p>
<p>Has anyone managed to integrate this with Paypal yet so the user gets their code right away?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-45904</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 14 Feb 2011 01:39:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-45904</guid>
		<description>Great script. Is there an easy way to have the link open a page then have the user click a download button instead of automatically starting the download? I want to present information then have the user input their email and agree to TOS before they can proceed with the download.

Thanks</description>
		<content:encoded><![CDATA[<p>Great script. Is there an easy way to have the link open a page then have the user click a download button instead of automatically starting the download? I want to present information then have the user input their email and agree to TOS before they can proceed with the download.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-43891</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Sat, 11 Dec 2010 16:35:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-43891</guid>
		<description>I know this is old now but thought i&#039;d update as I struggled to get this to work with multiple rar files being corrupted.

My only solution was to make an iso image of all the files then use it like this:

$mm_type=&quot;application/iso&quot;;
	   $file = &quot;download.iso&quot;;
	   $filename = &quot;bogus_download_name.iso&quot;;

	   header(&quot;Cache-Control: public, must-revalidate&quot;);
	   header(&quot;Pragma: no-cache&quot;);
	   header(&quot;Content-Type: &quot; . $mm_type);
	   header(&quot;Content-Length: &quot; .(string)(filesize($file)) );
	   header(&#039;Content-Disposition: attachment; filename=&quot;&#039;.$filename.&#039;&quot;&#039;);
	   header(&quot;Content-Transfer-Encoding: binary\n&quot;);

	   ob_end_clean();
	   readfile($file);


Very usefull script indeed. thanksKe</description>
		<content:encoded><![CDATA[<p>I know this is old now but thought i&#8217;d update as I struggled to get this to work with multiple rar files being corrupted.</p>
<p>My only solution was to make an iso image of all the files then use it like this:</p>
<p>$mm_type=&#8221;application/iso&#8221;;<br />
	   $file = &#8220;download.iso&#8221;;<br />
	   $filename = &#8220;bogus_download_name.iso&#8221;;</p>
<p>	   header(&#8220;Cache-Control: public, must-revalidate&#8221;);<br />
	   header(&#8220;Pragma: no-cache&#8221;);<br />
	   header(&#8220;Content-Type: &#8221; . $mm_type);<br />
	   header(&#8220;Content-Length: &#8221; .(string)(filesize($file)) );<br />
	   header(&#8216;Content-Disposition: attachment; filename=&#8221;&#8216;.$filename.&#8217;&#8221;&#8216;);<br />
	   header(&#8220;Content-Transfer-Encoding: binary\n&#8221;);</p>
<p>	   ob_end_clean();<br />
	   readfile($file);</p>
<p>Very usefull script indeed. thanksKe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vadim</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-36286</link>
		<dc:creator>vadim</dc:creator>
		<pubDate>Mon, 14 Jun 2010 12:10:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-36286</guid>
		<description>I&#039;m unable to force save as file. In my case I can see only source code of zip file in a different browsers, but there is no save as dialog.</description>
		<content:encoded><![CDATA[<p>I&#8217;m unable to force save as file. In my case I can see only source code of zip file in a different browsers, but there is no save as dialog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vadim</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-35907</link>
		<dc:creator>vadim</dc:creator>
		<pubDate>Fri, 11 Jun 2010 00:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-35907</guid>
		<description>Great idea. I think it will be better to make generated link clickable.</description>
		<content:encoded><![CDATA[<p>Great idea. I think it will be better to make generated link clickable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-33961</link>
		<dc:creator>Kris</dc:creator>
		<pubDate>Wed, 19 May 2010 17:57:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-33961</guid>
		<description>@alex

In the dbconnect.php, you need to edit the last line and insert &quot;MYCPANELLOGINNAME_database&quot; where it reads &quot;download&quot;.  This line is calling the specific name of the database which I assume you didn&#039;t name &quot;download&quot;.</description>
		<content:encoded><![CDATA[<p>@alex</p>
<p>In the dbconnect.php, you need to edit the last line and insert &#8220;MYCPANELLOGINNAME_database&#8221; where it reads &#8220;download&#8221;.  This line is calling the specific name of the database which I assume you didn&#8217;t name &#8220;download&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-33307</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Tue, 11 May 2010 06:07:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-33307</guid>
		<description>Hi,

I’m pretty sure i set it up correctly but am getting the following error:

Download Key Generator
Access denied for user ‘MYCPANELLOGINNAME_USERNAME’@&#039;localhost’ to database ‘download’.

I set all priviledges for the MYCPANELLOGINNAME_USERNAME to MYCPANELLOGINNAME_database? What am i doing wrong?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I’m pretty sure i set it up correctly but am getting the following error:</p>
<p>Download Key Generator<br />
Access denied for user ‘MYCPANELLOGINNAME_USERNAME’@&#8217;localhost’ to database ‘download’.</p>
<p>I set all priviledges for the MYCPANELLOGINNAME_USERNAME to MYCPANELLOGINNAME_database? What am i doing wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-32591</link>
		<dc:creator>Vincent</dc:creator>
		<pubDate>Fri, 30 Apr 2010 06:09:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-32591</guid>
		<description>If it says &quot;  Unknown column ‘uniqueid’ in ‘field list’ &quot;

i assume that means it cant find your database or the column named &quot;uniqeid&quot; in your database.  

did you change the names when running your MySQL query to create the tables?  if you did you have to change &quot;uniqueid&quot; to whichever column your keys are in.</description>
		<content:encoded><![CDATA[<p>If it says &#8221;  Unknown column ‘uniqueid’ in ‘field list’ &#8221;</p>
<p>i assume that means it cant find your database or the column named &#8220;uniqeid&#8221; in your database.  </p>
<p>did you change the names when running your MySQL query to create the tables?  if you did you have to change &#8220;uniqueid&#8221; to whichever column your keys are in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Sparks</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-32506</link>
		<dc:creator>Tim Sparks</dc:creator>
		<pubDate>Wed, 28 Apr 2010 23:52:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-32506</guid>
		<description>Hey Ardamis, 

This is a fantastically simple, clear and useful example. Thank you very, very, very much!

Tim</description>
		<content:encoded><![CDATA[<p>Hey Ardamis, </p>
<p>This is a fantastically simple, clear and useful example. Thank you very, very, very much!</p>
<p>Tim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mpeter</title>
		<link>http://www.ardamis.com/2008/06/11/protecting-a-download-using-a-unique-url/#comment-31512</link>
		<dc:creator>mpeter</dc:creator>
		<pubDate>Fri, 16 Apr 2010 15:38:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/?p=68#comment-31512</guid>
		<description>I&#039;m getting the same error as DTS.
I have followed your instructions and everything worked except for the message:

Unknown column &#039;uniqueid&#039; in &#039;field list&#039;

when trying to generate a downloadkey.

The download key is generated, but when I test the link I get the same error and nothing downloads.
It must be something with the mysql database.
Where have I gone wrong?</description>
		<content:encoded><![CDATA[<p>I&#8217;m getting the same error as DTS.<br />
I have followed your instructions and everything worked except for the message:</p>
<p>Unknown column &#8216;uniqueid&#8217; in &#8216;field list&#8217;</p>
<p>when trying to generate a downloadkey.</p>
<p>The download key is generated, but when I test the link I get the same error and nothing downloads.<br />
It must be something with the mysql database.<br />
Where have I gone wrong?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

