<?
require "config.php";
if(isset($_FILES["userfile"]))
{
switch($_FILES["userfile"]["error"])
{
case UPLOAD_ERR_INI_SIZE:
die("File error");
break;
case UPLOAD_ERR_FORM_SIZE:
die("File troppo grande");
break;
case UPLOAD_ERR_PARTIAL:
die("Upload eseguito parzialmente");
break;
case UPLOAD_ERR_NO_FILE:
die("Nessun file è stato inviato");
break;
case UPLOAD_ERR_NO_TMP_DIR:
die("Cartella temporanea non esistente");
break;
case UPLOAD_ERR_OK:
default:
mysql_query("INSERT INTO files (id, nome, size, tipo, file) VALUES (".$_SESSION['myid'].", '".$_FILES['userfile']['name']."', '".$_FILES['userfile']['size']."', '".$_FILES['userfile']['type']."', '".base64_encode(file_get_contents($_FILES['userfile']['tmp_name']))."')");
break;
}
?>
<html>
<head>
<title>Upload file</title>
</head>
<body background=images/main_bg.jpg>
<font color="#FFCC00">Il tuo file è stato inviato!!</font>
<font color="#FFCC00">Ritorna alla home</font>
</body>
</html>
<?
}
else
{
header("location:invia.html");
}
?>
---------------------------------------------------------------------------
<html>
<head>
<title>Upload file</title>
</head>
<body background=images/main_bg.jpg>
<form action="invia.php" method="post" name="form1" enctype="multipart/form-data" >
<hr><hr>
<table border="0" align="center" width="25%">
<tr>
<td width="27%"><font color="#FFCC00">Nome file:</font></td>
<td width="73%">
<input type="hidden" name="MAX_FILE_SIZE" value="128000000"><input type="file" value="" name="userfile" /></td>
</tr>
<tr>
<td colspan=2><input type="submit" value="------------------ Invia file ------------------" /></td>
</tr>
</table>
<hr><hr>
</form>
</body>
</html>
---------------------------------------------------------------------------
salve
il mio problema è il seguente:
quando faccio l'upload di un file se è di dimensione dell'ordine dei KB lo uppa se è da MB no
e non mi dice nemmeno se il file è tropo grande, quindi non penso faccia manko gli altri controlli sugli errori
potreste aiutarmi che ne ho urgente bisogno se è possibile avere un contatto diretto con un esperto sarebbe meglio
grazie