<?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[creare zip con nome]]></title><description><![CDATA[<p dir="auto">Ciao a tutti,<br />
ho scaricato questo bellissimo directory manager: <a href="http://ecosmear.com/relay/" rel="nofollow ugc">ecosmear.com/relay/</a><br />
Il punto è che quando si fa il download dei file caricati, crea uno zip sempre con lo stesso nome: package.zip.<br />
Credo che il problema sia nel file relay.php che copio:</p>
<pre><code>[....]
function getFilePackage($fileids,$returnContent = false){
    global $database,$fileinfo,$filepath;
    
    $fileids = preg_split("/\,/",$fileids);
    include_once("inc/createZip.inc.php");
    $createZip = new createZip;
    $fileCount = 0;
    logAction('getFilePackage',$fileids);
    foreach($fileids as $fileid){
        if(getFileInfo($fileid)){
            if(getUserAuth('download',$fileinfo['virtualpath'])){
                logAction('get',$fileid);
                $query = "update $GLOBALS[tablePrefix]filesystem set downloads=downloads+1 where id=$fileid";
                $result = mysql_query($query,$database);
                
                $createZip -&gt; addFile(file_get_contents($filepath), "$fileinfo[filename]");
                $fileCount++;
            }else{
                // denied
            }
        }else{
            // denied
        }
    }
    
    if($fileCount &gt; 0){
        if($returnContent != true){
            header("Content-Type: application/zip");
            header("Content-Transfer-Encoding: Binary");
            #header("Content-length: ".strlen($zipped));
            header("Content-disposition: attachment; filename=\"package.zip\"");
            echo $createZip -&gt; getZippedfile();
        }else{
            return $createZip-&gt;getZippedfile();
        }
    }else{
        error('no files zipped');
    }

}
[.....]
</code></pre>
<p dir="auto">Io vorrei invece che il nome dello zip fosse uguale al nome del file altrimenti è un casino.<br />
Chi sa aiutarmi?<br />
Grazie</p>
]]></description><link>https://dev.connect.gt/topic/89680/creare-zip-con-nome</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Dec 2026 11:45:10 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/89680.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Dec 2008 11:43:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to creare zip con nome on Tue, 09 Dec 2008 16:09:22 GMT]]></title><description><![CDATA[<p dir="auto">Come non detto, lo script è fighissimo, ma quando provo a scaricare file di grandi dimensioni ne scarica solo pochi kb.. <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=2190ae3dadd" class="not-responsive emoji emoji-android emoji--disappointed" style="height:1.4em;width:auto;vertical-align:middle" title=":(" alt="😞" /></p>
<p dir="auto">Peccato..</p>
]]></description><link>https://dev.connect.gt/post/790340</link><guid isPermaLink="true">https://dev.connect.gt/post/790340</guid><dc:creator><![CDATA[liberementi]]></dc:creator><pubDate>Tue, 09 Dec 2008 16:09:22 GMT</pubDate></item><item><title><![CDATA[Reply to creare zip con nome on Tue, 09 Dec 2008 13:37:37 GMT]]></title><description><![CDATA[<p dir="auto">Così funziona benissimo, scarico il file con il nome originario.. l'unica è che non mi crea lo zip <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/1881713c-5c09-4986-bf15-fa308ef84b2e-smilegt.gif?v=2190ae3dadd" class="not-responsive emoji emoji-customizations emoji--smile5" style="height:1.4em;width:auto;vertical-align:middle" title=":smile5:" alt="" /> .. ma se non si può fare diversamente va benissimo..</p>
<p dir="auto">Grazie Thedarkita <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/8d7b9529-9868-4606-8ca1-85ca7d28c845-wink.gif?v=2190ae3dadd" class="not-responsive emoji emoji-customizations emoji--wink3" style="height:1.4em;width:auto;vertical-align:middle" title=":wink3:" alt="" /></p>
]]></description><link>https://dev.connect.gt/post/790339</link><guid isPermaLink="true">https://dev.connect.gt/post/790339</guid><dc:creator><![CDATA[liberementi]]></dc:creator><pubDate>Tue, 09 Dec 2008 13:37:37 GMT</pubDate></item><item><title><![CDATA[Reply to creare zip con nome on Tue, 09 Dec 2008 13:30:32 GMT]]></title><description><![CDATA[<p dir="auto">Prova cosi:</p>
<pre><code class="language-php">[....]
function getFilePackage($fileids,$returnContent = false){
    global $database,$fileinfo,$filepath;
    
    $fileids = preg_split("/\,/",$fileids);
    include_once("inc/createZip.inc.php");
    $createZip = new createZip;
    $fileCount = 0;
    logAction('getFilePackage',$fileids);
    foreach($fileids as $fileid){
        if(getFileInfo($fileid)){
            if(getUserAuth('download',$fileinfo['virtualpath'])){
                logAction('get',$fileid);
                $query = "update $GLOBALS[tablePrefix]filesystem set downloads=downloads+1 where id=$fileid";
                $result =  mysql_query($query,$database);
                
                $createZip -&gt; addFile(file_get_contents($filepath), "$fileinfo[filename]");
                $fileCount++;
            }else{
                // denied
            }
        }else{
            // denied
        }
    }
    
    if($fileCount &gt; 0){
        if($returnContent != true){
            header("Content-Type: application/zip");
            header("Content-Transfer-Encoding: Binary");
            #header("Content-length: ".strlen($zipped));
            header("Content-disposition: attachment; filename=\"$fileinfo[filename]
\"");
             echo $createZip -&gt; getZippedfile();
        }else{
            return $createZip-&gt;getZippedfile();
        }
    }else{
        error('no files zipped');
    }

}
[.....]
</code></pre>
]]></description><link>https://dev.connect.gt/post/790338</link><guid isPermaLink="true">https://dev.connect.gt/post/790338</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Tue, 09 Dec 2008 13:30:32 GMT</pubDate></item></channel></rss>