<?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>ZoneArtCSS &#124; Desarrollo Web, Diseño de páginas Web, Aplicaciones Móviles, Notas de Tecnología &#187; archivos remotos</title>
	<atom:link href="http://www.zoneartcss.com/tag/archivos-remotos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zoneartcss.com</link>
	<description>Tips de Diseño y Desarrollo Web</description>
	<lastBuildDate>Wed, 26 Oct 2011 18:31:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Copiar archivos remotos con PHP</title>
		<link>http://www.zoneartcss.com/webdevelopment/php/copiar-archivos-remotos-con-php/</link>
		<comments>http://www.zoneartcss.com/webdevelopment/php/copiar-archivos-remotos-con-php/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 18:43:51 +0000</pubDate>
		<dc:creator>miguelortega</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[archivos remotos]]></category>
		<category><![CDATA[copiar archivos]]></category>
		<category><![CDATA[copiar archivos remotos]]></category>
		<category><![CDATA[copy files remotes]]></category>
		<category><![CDATA[miguel ortega]]></category>

		<guid isPermaLink="false">http://www.zoneartcss.com/?p=971</guid>
		<description><![CDATA[Copiar archivos remotos Si necesitas hacer una copia de un archivo remoto a tu servidor, con php es posible con un sencillo codigo, de echo a mi me hacia falta ese código y anduve investigando. Usa la funcion file_get_contents() y file_put_contents() para leer un archivo remoto y escribir su contenido en un archivo local &#60;?php // incrementamos el limite de ejecucion para este script ini_set&#40;'max_execution_time', 600&#41;; &#160; // definimos la URL del archivo a descargar [...]]]></description>
			<content:encoded><![CDATA[<div id=HOTWordsTxt name=HOTWordsTxt><p style="text-align: center;"><img class="aligncenter" src="http://zoneartcss.com/wp-content/copiar_php.jpg" alt="copi files" width="500" height="130" /></p>
<h4 style="text-align: center;"><span style="color: #ff9900;">Copiar archivos remotos</span></h4>
<p>Si necesitas hacer una <strong>copia de un archivo remoto</strong> a tu servidor, <strong>con php</strong>  es posible con un sencillo codigo, de echo  a mi me hacia falta ese código y anduve investigando.<br />
<span id="more-971"></span><br />
Usa la funcion file_get_contents() y file_put_contents() para leer un archivo remoto y escribir su contenido en un archivo local</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// incrementamos el limite de ejecucion para este script</span>
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'max_execution_time'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// definimos la URL del archivo a descargar</span>
<span style="color: #000088;">$ArchivoRemoto</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://zoneartcss.com/archivo.zip&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// definimos el nombre de la copia local</span>
<span style="color: #000088;">$ArchivoLocal</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;el_mio.zip&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Leemos el archivo remoto</span>
<span style="color: #000088;">$datos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ArchivoRemoto</span><span style="color: #009900;">&#41;</span>
    or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;No se piede leer el archivo remoto&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Escribimos los datos en el archivo local</span>
<span style="color: #990000;">file_put_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ArchivoLocal</span><span style="color: #339933;">,</span> <span style="color: #000088;">$datos</span><span style="color: #009900;">&#41;</span>
    or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;No se puede escribir el archivo local&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Mostramos un mensaje de confirmacion</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;El archivo [<span style="color: #006699; font-weight: bold;">$ArchivoRemoto</span>] fue copiado a [<span style="color: #006699; font-weight: bold;">$ArchivoLocal</span>]&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Espero que le sea de utilidad, saludos.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://www.zoneartcss.com/webdevelopment/php/copiar-archivos-remotos-con-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

