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

    upload: su un server si sull'altro no

    Utilizzo lo script di upload per un mio sito (http://www.supermix01.altervista.org...nzionante.html) e tutto va bene...

    ... quando lo stesso script lo uso su un server al quale pago regolare abbonamento non funziona: nel primo caso (altervista) i file sono direttamente messi nella root. nel secondo server il percorso dove caricare i file è public_html ... può essere la causa ? Dico subito che l'amministratore non sa che dirmi ??!!??

    lo script in questione è

    <?
    //user defined variables
    $abpath = "images"; //Absolute path to where images are uploaded. No trailing slash
    $sizelim = "no"; //Do you want size limit, yes or no
    $size = "2500000"; //What do you want size limited to be if there is one

    //all image types to upload
    $cert1 = "image/pjpeg"; //Jpeg type 1
    $cert2 = "image/jpeg"; //Jpeg type 2
    $cert3 = "image/gif"; //Gif type
    $cert4 = "image/ief"; //Ief type
    $cert5 = "image/png"; //Png type
    $cert6 = "image/tiff"; //Tiff type
    $cert7 = "image/bmp"; //Bmp Type
    $cert8 = "image/vnd.wap.wbmp"; //Wbmp type
    $cert9 = "image/x-cmu-raster"; //Ras type
    $cert10 = "image/x-x-portable-anymap"; //Pnm type
    $cert11 = "image/x-portable-bitmap"; //Pbm type
    $cert12 = "image/x-portable-graymap"; //Pgm type
    $cert13 = "image/x-portable-pixmap"; //Ppm type
    $cert14 = "image/x-rgb"; //Rgb type
    $cert15 = "image/x-xbitmap"; //Xbm type
    $cert16 = "image/x-xpixmap"; //Xpm type
    $cert17 = "image/x-xwindowdump"; //Xwd type

    $log = "";

    //begin upload 1

    //checks if file exists
    if ($img1_name == "") {
    $log .= "No file selected for upload 1
    ";
    }
    if ($img1_name != "") {
    //checks if file exists
    if (file_exists("$abpath/$img1_name")) {
    $log .= "File 1 already existed
    ";
    } else {

    //checks if files to big
    if ($sizelim == "yes") {
    if ($img1_size > $size) {
    $log .= "File 1 was too big
    ";
    }
    }

    //Checks if file is an image
    if (($img1_type == $cert1) or ($img1_type == $cert2) or ($img1_type == $cert3) or ($img1_type == $cert4) or ($img1_type == $cert5) or ($img1_type == $cert6) or ($img1_type == $cert7) or ($img1_type == $cert8) or ($img1_type == $cert9) or ($img1_type == $cert10) or ($img1_type == $cert11) or ($img1_type == $cert12) or ($img1_type == $cert13) or ($img1_type == $cert14) or ($img1_type == $cert15) or ($img1_type == $cert16) or ($img1_type == $cert17)) {
    @copy($img1, "$abpath/$img1_name") or $log .= "Couldn't copy image 1 to server
    ";
    if (file_exists("$abpath/$img1_name")) {
    $log .= "File 1 was uploaded
    ";
    }
    } else {
    $log .= "File 1 is not an image
    ";
    }
    }
    }
    //checks if file exists
    if ($img2_name == "") {
    $log .= "No file selected for upload 2
    ";
    }
    if ($img2_name != "") {

    //checks if file exists
    if (file_exists("$abpath/$img2_name")) {
    $log .= "File 2 already existed
    ";
    } else {

    //checks if files to big
    if ($sizelim == "yes") {
    if ($img2_size > $size) {
    $log .= "File 2 was too big]
    ";
    }
    }

    //Checks if file is an image
    if (($img2_type == $cert1) or ($img2_type == $cert2) or ($img2_type == $cert3) or ($img2_type == $cert4) or ($img2_type == $cert5) or ($img2_type == $cert6) or ($img2_type == $cert7) or ($img2_type == $cert8) or ($img2_type == $cert9) or ($img2_type == $cert10) or ($img2_type == $cert11) or ($img2_type == $cert12) or ($img2_type == $cert13) or ($img2_type == $cert14) or ($img2_type == $cert15) or ($img2_type == $cert16) or ($img2_type == $cert17)) {
    @copy($img2, "$abpath/$img2_name") or $log .= "Couldn't copy image 2 to server
    ";
    if (file_exists("$abpath/$img2_name")) {
    $log .= "File 2 was uploaded
    ";
    }
    } else {
    $log .= "File 2 is not an image
    ";
    }
    }
    }
    if ($img3_name == "") {
    $log .= "No file selected for upload 3
    ";
    }
    if ($img3_name != "") {

    //checks if file exists
    if (file_exists("$abpath/$img3_name")) {
    $log .= "File 3 already existed
    ";
    } else {

    //checks if files to big
    if ($sizelim == "yes") {
    if ($img3_size > $size) {
    $log .= "File 3 was too big
    ";
    }
    }

    //Checks if file is an image
    if (($img3_type == $cert1) or ($img3_type == $cert2) or ($img3_type == $cert3) or ($img3_type == $cert4) or ($img3_type == $cert5) or ($img3_type == $cert6) or ($img3_type == $cert7) or ($img3_type == $cert8) or ($img3_type == $cert9) or ($img3_type == $cert10) or ($img3_type == $cert11) or ($img3_type == $cert12) or ($img3_type == $cert13) or ($img3_type == $cert14) or ($img3_type == $cert15) or ($img3_type == $cert16) or ($img3_type == $cert17)) {
    @copy($img3, "$abpath/$img3_name") or $log .= "Couldn't copy image 3 to server
    ";
    if (file_exists("$abpath/$img3_name")) {
    $log .= "File 3 was uploaded
    ";
    }
    } else {
    $log .= "File 3 is not an image
    ";
    }
    }
    }
    if ($img4_name == "") {
    $log .= "No file selected for upload 4
    ";
    }
    if ($img4_name != "") {

    //checks if file exists
    if (file_exists("$abpath/$img4_name")) {
    $log .= "File 4 already existed
    ";
    } else {

    //checks if files to big
    if ($sizelim == "yes") {
    if ($img4_size > $size) {
    $log .= "File 4 was too big
    ";
    }
    }

    //Checks if file is an image
    if (($img4_type == $cert1) or ($img4_type == $cert2) or ($img4_type == $cert3) or ($img4_type == $cert4) or ($img4_type == $cert5) or ($img4_type == $cert6) or ($img4_type == $cert7) or ($img4_type == $cert8) or ($img4_type == $cert9) or ($img4_type == $cert10) or ($img4_type == $cert11) or ($img4_type == $cert12) or ($img4_type == $cert13) or ($img4_type == $cert14) or ($img4_type == $cert15) or ($img4_type == $cert16) or ($img4_type == $cert17)) {
    @copy($img4, "$abpath/$img4_name") or $log .= "Couldn't copy image 4 to server
    ";
    if (file_exists("$abpath/$img4_name")) {
    $log .= "File 4 was uploaded
    ";
    }
    } else {
    $log .= "File 4 is not an image
    ";
    }
    }
    }

    if ($img5_name == "") {
    $log .= "No file selected for upload 5
    ";
    }
    if ($img5_name != "") {
    //checks if file exists
    if (file_exists("$abpath/$img5_name")) {
    $log .= "File 5 already existed
    ";
    } else {

    //checks if files to big
    if ($sizelim == "yes") {
    if ($img5_size > $size) {
    $log .= "File 5 was too big
    ";
    }
    }

    //Checks if file is an image
    if (($img5_type == $cert1) or ($img5_type == $cert2) or ($img5_type == $cert3) or ($img5_type == $cert4) or ($img5_type == $cert5) or ($img5_type == $cert6) or ($img5_type == $cert7) or ($img5_type == $cert8) or ($img5_type == $cert9) or ($img5_type == $cert10) or ($img5_type == $cert11) or ($img5_type == $cert12) or ($img5_type == $cert13) or ($img5_type == $cert14) or ($img5_type == $cert15) or ($img5_type == $cert16) or ($img5_type == $cert17)) {
    @copy($img5, "$abpath/$img5_name") or $log .= "Couldn't copy image 5 to server
    ";
    if (file_exists("$abpath/$img5_name")) {
    $log .= "File 5 was uploaded
    ";
    }

    } else {
    $log .= "File 5 is not an image
    ";
    }
    }
    }
    ?>



    come posso fare?

    Ovviamente la cartella images ha chmod 777

    se metto chmod 777 a public_html non funzina più niente nel senso che mi da errore server


    GRAZIE

  2. #2
    Utente di HTML.it L'avatar di gianiaz
    Registrato dal
    May 2001
    Messaggi
    8,027
    leggiti questa guida e lascia perdere gli script già fatti:

    http://php.html.it/guide/lezione/269...ad-di-un-file/

    ciao

  3. #3
    madonna che me*da di script... upload in 10000 righe...
    www.gext.it

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.