<?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>Spartan Code - Blog &#187; forzar descarga</title>
	<atom:link href="http://www.spartan-code.com/blog/tag/forzar-descarga/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.spartan-code.com/blog</link>
	<description>web development</description>
	<lastBuildDate>Fri, 04 Nov 2011 19:43:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
	<!-- google_ad_section_end --><!-- google_ad_section_start(weight=ignore) -->	<item>
		<title>Función PHP para forzar la descarga de archivos</title>
		<link>http://www.spartan-code.com/blog/php/funcion-php-para-forzar-la-descarga-de-archivos/</link>
		<comments>http://www.spartan-code.com/blog/php/funcion-php-para-forzar-la-descarga-de-archivos/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 12:53:49 +0000</pubDate>
		<dc:creator>Pirata21</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[forzar descarga]]></category>

		<guid isPermaLink="false">http://www.spartan-code.com/blog/index.php/funcion-php-para-forzar-la-descarga-de-archivos/</guid>
		<description><![CDATA[function force_download($file) { if ((isset($file))&#38;&#38;(file_exists($file))) { header("Content-length: ".filesize($file)); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . $file . '"'); readfile("$file"); } else { echo "No se ha seleccionado ningún fichero"; } }]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: arial; font-size: 13px; line-height: normal; border-collapse: collapse" class="Apple-style-span"></span>
<pre style="font-size: 11px" name="code">function force_download($file)</pre>
<pre style="font-size: 11px" name="code">{</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">	</span>if ((isset($file))&amp;&amp;(file_exists($file)))</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">	</span>{</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">	</span>        header("Content-length: ".filesize($file));</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">		</span>header('Content-Type: application/octet-stream');</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">		</span>header('Content-Disposition: attachment; filename="' . $file . '"');</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">		</span>readfile("$file");</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">	</span>}</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">	</span>else</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">	</span>{</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">		</span>echo "No se ha seleccionado ningún fichero";</pre>
<pre style="font-size: 11px" name="code"><span style="white-space: pre" class="Apple-tab-span">	</span>}</pre>
<pre style="font-size: 11px" name="code"> }</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.spartan-code.com/blog/php/funcion-php-para-forzar-la-descarga-de-archivos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<!-- google_ad_section_end --><!-- google_ad_section_start(weight=ignore) --></channel>
</rss>

