file carica.php modificato


Codice PHP:

<?php
/*$TMPDIR="temp";
$filename=$HTTP_POST_FILES['miofile']['tmp_name'];
$realname=$HTTP_POST_FILES['miofile']['name'];
*/
// QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI
// DI PHP PRECEDENTI ALLA 4.1.0
if(!isset($_FILES)) $_FILES $HTTP_POST_FILES;
if(!isset(
$_SERVER)) $_SERVER $HTTP_SERVER_VARS;
/********************* VARIABILI DA SETTARE ********************/
// Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto)
$upload_dir="upf";
$cli=$_POST["cliente"];
// nome del file = a quello in UP
$new_name "$cli.xls";
// Se $new_name è vuota, il nome sarà lo stesso del file uploadato
$file_name = ($new_name) ? $new_name $_FILES["upfile"]["name"];
if(
trim($_FILES["upfile"]["name"]) == "") {
die(
"Non hai indicato il file da uploadare !");
}
if(
is_uploaded_file($_FILES["upfile"]["tmp_name"])) {
move_uploaded_file($_FILES["upfile"]["tmp_name"], "$upload_dir/$file_name")
or die(
"Impossibile spostare il file, controlla l'esistenza o i permessi della directory dove fare l'upload.");
}else{
//die("Problemi nell'upload del file " . $_FILES["upfile"]["name"]);
//
$er=$_FILE['upfile']['error'];
switch (
$er)
{     
     case 
0:
             
$msg "No Error"// comment this out if you don't want a message to appear on success.
             
break;
     case 
1:
              
$msg "The file is bigger than this PHP installation allows";
              break;
      case 
2:
              
$msg "The file is bigger than this form allows";
              break;
       case 
3:
              
$msg "Only part of the file was uploaded";
              break;
       case 
4:
             
$msg "No file was uploaded";
              break;
       case 
6:
             
$msg "Missing a temporary folder";
              break;
       case 
7:
             
$msg "Failed to write file to disk";
             break;
       case 
8:
             
$msg "File upload stopped by extension";
             break;
       default:
            
$msg "unknown error ".$_FILES['Filedata']['error'];
            break;
}

If (
$msg)
    
$stringData "Errore : ".$er." Informazioni >: ".$msg;
else
   
$stringData "1"// This is required for onComplete to fire on Mac OSX
echo $stringData;
//
}
die();
if(
$cli=="giv")header("Location:impgiv.php?fde=$cli");
if(
$cli=="qfg")header("Location:impqfg.php?fde=$cli");
if(
$cli=="pgm")header("Location:imppgm.php?fde=$cli");
/*
if(@is_uploaded_file($_FILES["upfile"]["tmp_name"])) {
@move_uploaded_file($_FILES["upfile"]["tmp_name"], "$upload_dir/$file_name")
or die("Impossibile spostare il file, controlla l'esistenza o i permessi della directory dove fare l'upload.");
}else{
die("Problemi nell'upload del file " . $_FILES["upfile"]["name"]);
}
*/
?>
errore a video Errore : Informazioni >: No Error

errore file di log .../serv/aqdt/carica.php on line 28