Visualizzazione risultati 1 fino 8 di 8

Discussione: script upload

  1. #1
    Guest

    Predefinito

    Ho un problema :
    devo mettere lo script per l'upload sul mio sito !
    ma non funziona !
    devo settare qualche parametro ? oppure c'è un errore ? e il chmod 777 ?
    date un'occhiata www.mastervb.altervista.org alla sezione upload !
    Per favore !

  2. #2
    Guest

    Predefinito

    Hei !
    Aiutatemi !

  3. #3
    L'avatar di Evcz
    Evcz non è connesso Utente storico
    Data registrazione
    31-05-2002
    Residenza
    Vicenza
    Messaggi
    5,670

    Predefinito

    Citazione Originalmente inviato da mastervb
    Hei !
    Aiutatemi !
    come hai fatto lo scrip?

    hai usato il metodo copy() ?

    che errori ti da?

    posta qui lo script, comunque la sezione adatta era "livello 4 - php".
    There are three kinds of people in this world: people who watch things happen ... people who complain about things that happen ... and people who make things happen...

  4. #4
    Guest

    Predefinito

    Sono due pagine :
    la prima E config.php

    <?
    //Advanced Uploader V1.00b
    //Copyright 2002 ZachWhite.com
    //By using this program you agree with the license provide with it.
    //Script by Zach White http://www.zachwhite.com zachwhite@zachwhite.com

    $absolute_path = "file"; //Absolute path to where files are uploaded
    $size_limit = "yes"; //do you want a size limit yes or no.
    $limit_size = "20000000"; //How big do you want size limit to be in bytes
    $limit_ext = "yes"; //do you want to limit the extensions of files uploaded
    $ext_count = "6"; //total number of extensions in array below
    $extensions = array(".gif", ".jpg", ".jpeg", ".png", ".zip", ".rar",); //List extensions you want files uploaded to be
    ?>



    -------------------------------------------.-------------------------------------
    La seconda è :

    <?
    //Advanced Uploader V1.00b
    //Copyright 2002 ZachWhite.com
    //By using this program you agree with the license provide with it.
    //Script by Zach White http://www.zachwhite.com zachwhite@zachwhite.com

    $upload = "";
    switch($upload) {
    default:
    include "config.php";
    echo "
    <html>

    <head>
    <title>Upload</title>
    </head>

    <body topmargin=\"10\" leftmargin=\"0\" bgcolor=\"#18576F\" link=\"#818EA0\" vlink=\"#5C697A\" alink=\"#818EA0\" text=\"#FFFFFF\" style=\"font-family: Verdana; font-size: 8pt; color: #FFFFFF\">



    <div align=\"center\">
    <center>
    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"400\" id=\"AutoNumber1\">
    <tr>
    <td bgcolor=\"#5E6A7B\" height=\"25\">
    <p align=\"center\"><font size=\"2\"><b>Upload File</b></font></td>
    </tr>
    <tr>
    <td bgcolor=\"#818EA0\"><font size=\"2\">The following restrictions apply:</font><ul type=\"square\">
    <li><font size=\"2\">File extension must be <b>";
    if (($extensions == "") or ($extensions == " ") or ($ext_count == "0") or ($ext_count == "") or ($limit_ext != "yes") or ($limit_ext == "")) {
    echo "any extension";
    } else {
    $ext_count2 = $ext_count+1;
    for($counter=0; $counter<$ext_count; $counter++) {
    echo "  $extensions[$counter]";
    }
    }
    if (($limit_size == "") or ($size_limit != "yes")) {
    $limit_size = "any size";
    } else {
    $limit_size .= " bytes";
    }
    echo"</b></font></li>
    <li><font size=\"2\">Maximum file size is $limit_size</font></li>
    <li><font size=\"2\">No spaces in the filename</font></li>
    <li><font size=\"2\">Filename cannot contain illegal characters
    (/,*,\,etc)</font><BR>
    </li>
    </ul>
    <form method=\"POST\" action=\"$PHP_SELF?upload=doupload\" enctype=\"multipart/form-data\">
    <p align=\"center\">
    <input type=file name=file size=30 style=\"font-family: v; font-size: 10pt; color: #5E6A7B; border: 1px solid #5E6A7B; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\"><br>
    <br>
    <button name=\"submit\" type=\"submit\" style=\"font-family: v; font-size: 10pt; color: #5E6A7B; border: 1px solid #5E6A7B; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\">Upload</button>
    </p>
    </form>
    <p>
    </td>
    </tr>
    <tr>
    <td bgcolor=\"#5E6A7B\" height=\"25\">
    <p align=\"center\"><font size=\"1\">
    <a href=\"http://www.zachwhite.com/index.php\"><font color=\"#FFFFFF\">
    ZachWhite.com File Uploader</font></a></font><br>
    <font size=\"1\">Template By <a href=\"http://www.peekj.ca\">
    <font color=\"#FFFFFF\">Jan Ole Peek</font></a></font></td>
    </tr>
    </table>
    </center>
    </div>


    </body>

    </html>";
    break;
    case "doupload":
    include "config.php";
    $endresult = "<font size=\"2\">File Was Uploaded</font>";
    if ($file_name == "") {
    $endresult = "<font size=\"2\">No file selected</font>";
    }else{
    if(file_exists("$absolute_path/$file_name")) {
    $endresult = "<font size=\"2\">File Already Existed</font>";
    } else {
    if (($size_limit == "yes") && ($limit_size < $file_size)) {
    $endresult = "<font size=\"2\">File was to big</font>";
    } else {
    $ext = strrchr($file_name,'.');
    if (($limit_ext == "yes") && (!in_array($ext,$extensions))) {
    $endresult = "<font size=\"2\">File is wrong type</font>";
    }else{
    @copy($file, "$absolute_path/$file_name") or $endresult = "<font size=\"2\">Couldn't Copy File To Server</font>";
    }
    }
    }
    }
    echo "
    <html>

    <head>
    <title>Upload</title>
    </head>

    <body topmargin=\"10\" leftmargin=\"0\" bgcolor=\"#18576F\" link=\"#818EA0\" vlink=\"#5C697A\" alink=\"#818EA0\" text=\"#FFFFFF\" style=\"font-family: Verdana; font-size: 8pt; color: #FFFFFF\">



    <div align=\"center\">
    <center>
    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"400\" id=\"AutoNumber1\">
    <tr>
    <td bgcolor=\"#5E6A7B\" height=\"25\">
    <p align=\"center\"><font size=\"2\"><b>Upload File</b></font></td>
    </tr>
    <tr>
    <td bgcolor=\"#818EA0\">
    <center> $endresult </center>
    </td>
    </tr>
    <tr>
    <td bgcolor=\"#5E6A7B\" height=\"25\">
    <p align=\"center\"><font size=\"1\">
    <a href=\"http://www.zachwhite.com/index.php\"><font color=\"#FFFFFF\">
    ZachWhite.com File Uploader</font></a></font><br>
    <font size=\"1\">Template By <a href=\"http://www.peekj.ca\">
    <font color=\"#FFFFFF\">Jan Ole Peek</font></a></font></td>
    </tr>
    </table>
    </center>
    </div>


    </body>

    </html>";
    break;
    }
    ?>

  5. #5
    Guest

    Predefinito

    HELP me!

  6. #6
    Guest

    Predefinito

    Citazione Originalmente inviato da mastervb
    HELP me!
    ....

    Citazione Originalmente inviato da evcz
    come hai fatto lo scrip?

    hai usato il metodo copy() ?
    [code:1:eb6a60b87d]@copy($file, "$absolute_path/$file_name") [/code:1:eb6a60b87d]

  7. #7
    Guest

    Predefinito

    Citazione Originalmente inviato da mastervb
    HELP me!
    ....

    Citazione Originalmente inviato da evcz
    come hai fatto lo scrip?

    hai usato il metodo copy() ?
    [code:1:eb6a60b87d]@copy($file, "$absolute_path/$file_name") [/code:1:eb6a60b87d]

  8. #8
    Guest

    Predefinito

    Non è questione di path !

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •