<?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>download Archivi -</title>
	<atom:link href="https://simonetocco.it/tag/download/feed/" rel="self" type="application/rss+xml" />
	<link>https://simonetocco.it/tag/download/</link>
	<description></description>
	<lastBuildDate>Fri, 26 Oct 2018 10:59:32 +0000</lastBuildDate>
	<language>it-IT</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://simonetocco.it/wp-content/uploads/2020/12/logoSimone-1-150x150.png</url>
	<title>download Archivi -</title>
	<link>https://simonetocco.it/tag/download/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Codice PHP Download File: forzare il download per scaricare un file</title>
		<link>https://simonetocco.it/codice-php-download-file-forzare-il-download-per-scaricare-un-file/</link>
					<comments>https://simonetocco.it/codice-php-download-file-forzare-il-download-per-scaricare-un-file/#respond</comments>
		
		<dc:creator><![CDATA[Simone Tocco]]></dc:creator>
		<pubDate>Fri, 26 Oct 2018 10:58:41 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Pillole]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">https://simonetocco.it/?p=1807</guid>

					<description><![CDATA[<p>Realizzando una Web Application in linguaggio PHP, può essere necessario abilitare una funzione che consente di forzare il download per scaricare un file. Il Codice PHP per il download di file è molto semplice ma in rete si trovano diversi codici che spesso non funzionano o generano dei file corrotti quindi non apribili. Inserisco quindi [&#8230;]</p>
<p>L'articolo <a href="https://simonetocco.it/codice-php-download-file-forzare-il-download-per-scaricare-un-file/">Codice PHP Download File: forzare il download per scaricare un file</a> sembra essere il primo su <a href="https://simonetocco.it"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Realizzando una Web Application in linguaggio PHP, può essere necessario abilitare una funzione che consente di <strong>forzare il download</strong> per scaricare un file. Il <strong>Codice PHP per il download di file</strong> è molto semplice ma in rete si trovano diversi codici che spesso non funzionano o generano dei file corrotti quindi non apribili.</p>
<p>Inserisco quindi un codice testato e funzionante per il download di un file .ZIP o PDF o JPEG o JPG. Per altre tipologie di file, sarà sufficiente modificare la tipologia di file da scaricare:</p>
<p>&nbsp;</p>
<p><code>$file_name = "nomefile.zip";<br />
if( !is_file($file_name) )<br />
exit();<br />
if(ini_get('zlib.output_compression'))<br />
ini_set('zlib.output_compression', 'Off');<br />
switch(strtolower(substr(strrchr($file_name,'.'),1)))<br />
{<br />
case 'pdf': $mime = 'application/pdf'; break;<br />
case 'zip': $mime = 'application/zip'; break;<br />
case 'jpeg':<br />
case 'jpg': $mime = 'image/jpg'; break;<br />
default: exit();<br />
}<br />
header('Pragma: public');<br />
header('Expires: 0');<br />
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');<br />
header('Last-Modified: '.gmdate ('D, d M Y H:i:s', filemtime ($file_name)).' GMT');<br />
header('Cache-Control: private',false);<br />
header('Content-Type: '.$mime);<br />
header('Content-Disposition: attachment; filename="'.basename($file_name).'"');<br />
header('Content-Transfer-Encoding: binary');<br />
header('Content-Length: '.filesize($file_name));<br />
header('Connection: close');<br />
ob_clean();<br />
readfile($file_name);</code></p>
<!--------------------------------------><!-- Conversion Box Made Using : -------><!-- WP Conversion Boxes - -------------><!-- http://wpconversionboxes.com --><!--------------------------------------><div class="wpcb_nothing_offset"></div>

<style>
    
    .wpcb_template_main_1{
        
        background-color: #0faf97;
        width: 100%;
        height: ;
        border-width: ;
        border-color: ;
        margin-top: ;
        margin-bottom: ;
        margin-left: ;
        margin-right: ;
        padding: 20px;
        -webkit-box-shadow: inset 0px 0px 200px -38px rgba(0,0,0,0.5);
        -moz-box-shadow: inset 0px 0px 200px -38px rgba(0,0,0,0.5);
        box-shadow: inset 0px 0px 200px -38px rgba(0,0,0,0.5);     
        
    }
    
    .wpcb_template_main_1 .wpcb_box_heading{
        background-color: ;
        padding-top: 0px;
    }
    
    .wpcb_template_main_1 .wpcb_box_heading_text{
        font-family:    'Arial', serif;
        font-size:      32px;
        line-height:    38px;
        color:          #ffffff;
        text-align:     center;
        text-shadow: 0px 3px 4px rgba(0, 0, 0, 0.25);
        font-weight: 900;
        margin: 0;
    }
    
    .wpcb_template_main_1 .wpcb_box_content_container{
        
    }    
    
    .wpcb_template_main_1 .wpcb_box_content{
        font-family:    Arial;
        font-size:      20px;
        line-height:    24px;
        color:          #ffffff;
        text-align:     center;
        padding: 20px 0px;
    }
    
    .wpcb_template_main_1 .wpcb_box_button_div{
        text-align: center;
    }
    
    .wpcb_template_main_1 .wpcb_box_button_div a.wpcb_box_button, .wpcb_template_main_1 .wpcb_box_button_div button.wpcb_box_button{
        font-family:    Arial;
        font-size:      16px;
        color:          #fff;
        background-color: #4f78f2;
        border-radius: 30px;
        width: ;
        padding: 10px 15px;
    }
    
    .wpcb_button_gradient{background-image : -moz-linear-gradient(top, #4f78f2, #1851f9);background-image : -ms-linear-gradient(top, #4f78f2, #1851f9);background-image : -webkit-gradient(linear, #4f78f2, #1851f9);background-image : -webkit-linear-gradient(top, #4f78f2, #1851f9);background-image : -o-linear-gradient(top, #4f78f2, #1851f9);background-image : linear-gradient(top, #4f78f2, #1851f9);filter : progid:DXImageTransform.Microsoft.gradient(startColorstr=&quot;#4f78f2&quot;, endColorstr=&quot;#1851f9&quot;, GradientType=0);border-color : +#4f78f2 #1851f9 #1851f9;background-color : #4f78f2;}    
        
</style>


<div class="wpcb_template_main wpcb_template_main_1 wpcb_nothing wpcb_nothing" data-fadetime="0">
    <div class="wpcb_box_all_content_container">
        <div class="wpcb_box_content_container">    
            <div class="wpcb_box_heading">
                <div class="wpcb_box_heading_text">Hai bisogno di una consulenza o assistenza?</div>
            </div>            
            <div class="wpcb_box_content">
                Apri un ticket di richiesta, ti risponderò in brevissimo tempo! Chiedere non costa nulla <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" />            </div>    
            <div class="wpcb_box_button_div">
                <a href="http://simonetocco.it/assistenza-e-consulenza/" target="" id="wpcb_box_button_1" class="wpcb_box_button wpcb_button_gradient">Apri Richiesta</a>
            </div>
        </div>    
    </div>
</div><!------------------------------><!-- Conversion Box Ends Here --><!------------------------------><div class="wpcb-tracker" data-id="3640002" data-boxid="1" data-visitedpage="https://simonetocco.it:443/tag/download/feed/" data-visittype="visit"></div><p>L'articolo <a href="https://simonetocco.it/codice-php-download-file-forzare-il-download-per-scaricare-un-file/">Codice PHP Download File: forzare il download per scaricare un file</a> sembra essere il primo su <a href="https://simonetocco.it"></a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://simonetocco.it/codice-php-download-file-forzare-il-download-per-scaricare-un-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
