Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Aug 2006
    Messaggi
    833

    Non riesco a fare sempre il download dei file

    Ciao, ho un problema con il file dirlist.php.
    In pratica quando ci sono es. tre file .zip da scaricare e linko il primo e poi annullo, linko il secondo e il terzo e annullo, quando torno sul primo file della lista e lo linko mi dice pagina notfound. Ho cercato in giro ma c'e' solo questo dirlist.php.
    Mi sapete dire dove' l'errore o se c'e' un altro file che fa la stessa cosa del dirlist? grazie posto il file


    <?

    // Processing variables by "GET" input

    $inpath = $_GET['dir'];
    $sub = $_GET['sub'];

    if (!IsSet($inpath) || ($inpath == ""))
    {
    $inpath = "";
    $directory = ".";
    }
    else $directory = explode("|",$inpath);

    if (!IsSet($sub) || ($sub < 0))
    {
    $sub = 0;
    $directory = ".";
    }

    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Esplora Risorse</title>
    <style type="text/css">
    .navigate
    {
    font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-weight : normal;
    font-size : 10px;
    color: blue;
    }
    .title
    {
    font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-weight : bold;
    font-size : 14px;
    color: black;
    }
    .dir
    {
    font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-weight : bold;
    font-size : 12px;
    color: navy;

    }
    .file
    {
    font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-weight : normal;
    font-size : 12px;
    color: blue;
    }
    .copy
    {
    font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-weight : normal;
    font-size : 10px;
    color: black;
    }

    </style>
    <body>

    <div class="title">Directory:</div>
    Home
    <?

    // Processing directories

    $path = "";
    for ($i=0; $i<=$sub; $i++)
    {
    $folder = chdir($directory[$i]);
    $path = $path . $directory[$i] . "|";
    if (($directory[$i] != "") and ($directory[$i] != "."))
    echo " - <a class=\"navigate\" href=\"dirlist.php?dir=". $path . "&sub=".($i+1)."\">" . $directory[$i] . "</a>";
    }

    echo "\n<hr>\n";

    // Getting directory's info...

    $folder = opendir(".");

    while ($file = ReadDir($folder))
    {
    $file_array[] = $file;
    }

    // Processing Files&Directories list element by element

    foreach ($file_array as $file) {

    if (($file == ".") || ($file == "..") ) continue;

    // Checking if it is a directory or a file

    if (FileType($file) == dir)
    {
    if ($inpath != "")
    {
    $path = $inpath . $file . "|";
    $subw = $sub + 1;
    }
    else
    {
    $path = $file ."|";
    $subw = 1;
    }

    $listpath[] = "<a class=\"dir\" href=\"dirlist.php?dir=".$path."&sub=".$subw."\">" .$file."</a>
    \n";
    }
    else
    {
    if ($inpath != "")
    $path = str_replace("|","/",$inpath) . $file;
    else
    $path = $file;

    *****************Il problema e' qua quando si crea qua il percorso**************

    $listfiles[] = "<a class=\"file\" href=\"".$path."\" target=\"_new\">".$file."</a>
    \n";
    }

    }
    // Printing the list

    for ($id=0; $id<count($listpath); $id++) echo $listpath[$id];
    for ($id=0; $id<count($listfiles); $id++) echo $listfiles[$id];

    // Unsetting all variables
    unset($file_array);
    unset($file);
    unset($folder);
    unset($directory);
    unset($sub);
    unset($subw);
    unset($path);
    unset($id);
    unset($listpath);
    unset($listfiles);
    ?>
    <hr>
    </body>
    </html>

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2006
    Messaggi
    833
    up

  3. #3
    Utente di HTML.it
    Registrato dal
    Aug 2006
    Messaggi
    833
    Consigli

  4. #4
    Utente di HTML.it
    Registrato dal
    Aug 2006
    Messaggi
    833
    up

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.