- Code: Select all
<html>
<head>
<title>Upload di file in PHP</title>
</head>
<body>
<h1>Upload</h1>
<b>Dimesione massima: 5mb<br>Per upload di file più grandi, utilizzare <a href="ftpaccess.php">l'accesso via FTP</a></b>
<form method="post" action="up.php" enctype="multipart/form-data">
<input type="file" name="fdc" size="50">
<input type="submit" name="upload" value="Upload">
<input value="<?php echo "".$_GET['ps']; ?>" name="a" type="hidden">
</form>
<?
if ($_POST["upload"] != "")
{
//$percorso = "../pubblic/video/";
//$percorso = "http://gabriele97.no-ip.org".$_GET['ps']."/";
$percorso = "..".$_POST['a']."/";
$fdc_temp = $_FILES["fdc"]["tmp_name"];
$fdc_name = $_FILES["fdc"]["name"];
if (move_uploaded_file($fdc_temp, $percorso . $fdc_name))
{
$ciao = $_POST['a'];
//echo "Upoload eseguito con successo.<br> <a href='$percorso'>Torna Indietro</a> o <a href='up.php?ps=$ciao'>Riesegui un'altro upload</a>";
header("location: $percorso");
}
else
{
echo "Si è verificato un errore in fase di upoload<br>";
echo "Riprova";
}
}
?>
</body>
</html>
can try here: File Upload in PHP
then, if I try to run the file upload that measure less than 5mb okay, but if I try to upload files larger than 5mb, I get redirected to the page without up.php? ps = / public
I can not understand why ... HELP!