<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Archives &#8211; Beer &amp; Skittles</title>
	<atom:link href="https://nelson.ph/archives/programming/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://nelson.ph/archives/programming/php/</link>
	<description>Life is not all beer and skittles</description>
	<lastBuildDate>Fri, 01 May 2020 03:56:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
<site xmlns="com-wordpress:feed-additions:1">177521838</site>	<item>
		<title>Downloading Files using PHP</title>
		<link>https://nelson.ph/2020/04/downloading-files-using-php/</link>
					<comments>https://nelson.ph/2020/04/downloading-files-using-php/#respond</comments>
		
		<dc:creator><![CDATA[Nelson]]></dc:creator>
		<pubDate>Sat, 18 Apr 2020 02:28:36 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://nelson.ph/?p=1859</guid>

					<description><![CDATA[<p>Last week I revamped my anime collective and among the changes was the removal of the lightbox when downloading an avatar. Naturally came across countless solutions on the Innernet but nothing compared to how PHP Tutorial Point handled it. The fewest lines but the most readable! $file = "vaccines/covid19.pdf"; header("Content-Type: " . filetype($file)); header("Content-Length: " [&#8230;]</p>
<p>The post <a href="https://nelson.ph/2020/04/downloading-files-using-php/">Downloading Files using PHP</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Last week I revamped my <a href="https://akiba.flirt-wind.net/39-self-isolation-stats/">anime collective</a> and among the changes was the removal of the lightbox when downloading an avatar. Naturally came across countless solutions on the Innernet but nothing compared to how <a href="https://www.phptpoint.com/how-to-download-file-in-php/">PHP Tutorial Point</a> handled it. The fewest lines but the most readable!</p>
<pre class="EnlighterJSRAW" data-enlighter-language="php">$file = "vaccines/covid19.pdf";
header("Content-Type: " . filetype($file));
header("Content-Length: " . filesize($file));
header("Content-Disposition: attachment; filename=" . basename($file));
readfile($file);
</pre>
<p>Make sure that the path to the file is relative to the file where the code is.</p>
<p>The post <a href="https://nelson.ph/2020/04/downloading-files-using-php/">Downloading Files using PHP</a> appeared first on <a href="https://nelson.ph">Beer &amp; Skittles</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nelson.ph/2020/04/downloading-files-using-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1859</post-id>	</item>
	</channel>
</rss>
