<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problema con il download di un file pdf]]></title><description><![CDATA[<p dir="auto">Salve,<br />
sono nuovo e non so bene come funziona.<br />
Ho un problema con il download di un file pdf<br />
con uno script in PHP, e mi serviva un aiuto.<br />
Sono nel posto giusto....</p>
]]></description><link>https://dev.connect.gt/topic/114073/problema-con-il-download-di-un-file-pdf</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 15:39:37 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/114073.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Nov 2009 12:16:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problema con il download di un file pdf on Tue, 10 Nov 2009 12:27:56 GMT]]></title><description><![CDATA[<p dir="auto">Ho provato ad inserire il codice che mi hai postato,<br />
ma non ho risolto.<br />
Non mi dà errore, ma nella mascherina che mi si apre,<br />
dove mi chiede se voglio salvare o aprire il file, non mi segnala<br />
la dimensione del file.<br />
E' come se legesse 0 KB.<br />
Con un file più piccolo (3,77 Mega) funziona tutto, anche se poi, aprendolo e scorrendo le varie pagine, mi dà un errore di disegno.<br />
Grazie</p>
]]></description><link>https://dev.connect.gt/post/869417</link><guid isPermaLink="true">https://dev.connect.gt/post/869417</guid><dc:creator><![CDATA[aviscome]]></dc:creator><pubDate>Tue, 10 Nov 2009 12:27:56 GMT</pubDate></item><item><title><![CDATA[Reply to Problema con il download di un file pdf on Tue, 10 Nov 2009 10:47:46 GMT]]></title><description><![CDATA[<p dir="auto">Sarebbe meglio se riportassi esattamente l'errore cosi come viene presentato nel browser, magari si tratta di un semplice timeout date le dimensioni del file,<br />
prova ad inserire come prima istruzione</p>
<pre><code>set_time_limit(600); // equivale a 10 minuti
</code></pre>
]]></description><link>https://dev.connect.gt/post/869408</link><guid isPermaLink="true">https://dev.connect.gt/post/869408</guid><dc:creator><![CDATA[artechbrand]]></dc:creator><pubDate>Tue, 10 Nov 2009 10:47:46 GMT</pubDate></item><item><title><![CDATA[Reply to Problema con il download di un file pdf on Tue, 10 Nov 2009 10:40:14 GMT]]></title><description><![CDATA[<p dir="auto">Lo script che utilizzo è il seguente:</p>
<pre><code class="language-php">&lt;?php
$file_name = "2005.pdf";   # file name, UTF-8 encoded
$file_mime = "application/pdf";    # MIME type
$file_path = "portaldata/UserFiles/File/2005.pdf";
header("Content-Type: octet-stream");
header("Content-Length: " . filesize($file_path));
$agent = $_SERVER["HTTP_USER_AGENT"];
if( is_int(strpos($agent, "MSIE")) ){
    # Remove reserved chars: :\/*?"&lt;&gt;|
    $fn = preg_replace('/[:\\x5c\\/*?"&lt;&gt;|]/', '_', $file_name);
    # Non-standard URL encoding:
    header("Content-Disposition: attachment; filename="
    . rawurlencode($fn));
} else if( is_int(strpos($agent, "Gecko")) ){
    # RFC 2231:
    header("Content-Disposition: attachment; filename*=UTF-8''"
    . rawurlencode($file_name));
} else if( is_int(strpos($agent, "Opera")) ) {
    # Remove reserved chars: :\/*{?
    $fn = preg_replace('/[:\\x5c\\/{?]/', '_', $file_name);
    # RFC 2231:
    header("Content-Disposition: attachment; filename*=UTF-8''"
    . rawurlencode($fn));
} else {
    # RFC 2616 ASCII-only encoding:
    $fn = mb_convert_encoding($file_name, "US-ASCII", "UTF-8");
    $fn = (string) str_replace("\\", "\\\\", $fn);
    $fn = (string) str_replace("\"", "\\\"", $fn);
    header("Content-Disposition: attachment; filename=\"$fn\"");
}
readfile($file_path);

?&gt;
</code></pre>
<p dir="auto">Il problema che il file pdf (creto con INdesign) è di 22 Mega<br />
e sembra non riesco a fare il download di file superiori a 3 Mega.</p>
]]></description><link>https://dev.connect.gt/post/869414</link><guid isPermaLink="true">https://dev.connect.gt/post/869414</guid><dc:creator><![CDATA[aviscome]]></dc:creator><pubDate>Tue, 10 Nov 2009 10:40:14 GMT</pubDate></item><item><title><![CDATA[Reply to Problema con il download di un file pdf on Fri, 06 Nov 2009 13:13:07 GMT]]></title><description><![CDATA[<p dir="auto">Ciao, dovresti descrivere il problema e postare eventualmente il codice utilizzato per ricevere qualche aiuto.</p>
]]></description><link>https://dev.connect.gt/post/869407</link><guid isPermaLink="true">https://dev.connect.gt/post/869407</guid><dc:creator><![CDATA[artechbrand]]></dc:creator><pubDate>Fri, 06 Nov 2009 13:13:07 GMT</pubDate></item></channel></rss>