I am having some troubles with file uploads on my server and was
hoping you guys could help out.
PHP is returning with the error UPLOAD_ERR_INI_ SIZE for all files over
approx. 4Kb. I have set the upload_max_file size to 1Gb, and ini_get()
reports that correctly.
You can run my little sample script here: http://www.paramountlists.com/v3/ftp/cff_test2.php
And now for the script:
<?php error_reporting (E_ALL); ?>
<html>
<head>
<title>Upload </title>
</head>
<body>
<?
if (!empty($_POST['upload'])) {
echo "<pre>";
print_r($_FILES );
echo "</pre><br>";
switch ($_FILES['myfile']['error']) {
case UPLOAD_ERR_OK:
echo "Upload was ok";
break;
case UPLOAD_ERR_INI_ SIZE:
echo "Exceeds upload_max_file size:
".ini_get("uplo ad_max_filesize ");
break;
case UPLOAD_ERR_FORM _SIZE:
echo "exceeds the MAX_FILE_SIZE." ;
break;
case UPLOAD_ERR_PART IAL:
echo "The uploaded file was only partially uploaded.";
break;
case UPLOAD_ERR_NO_F ILE:
echo "No file was uploaded.";
break;
case UPLOAD_ERR_NO_T MP_DIR:
echo "Missing a temporary folder.";
break;
case UPLOAD_ERR_CANT _WRITE:
echo "Failed to write file to disk";
break;
default:
echo "Unknown File Error";
}
echo "<br>";
}
?>
<form method="post" enctype="multip art/form-data"
action="<?php echo $_SERVER['PHP_SELF'];?>">
<input type="hidden" name="MAX_FILE_ SIZE" value="5000000" >
Upload File: <input name="myfile" type="file"><br >
<input name="upload" type="submit" value="Submit"> </form>
</body>
</html>
If you guys think this would be better asked at the apache newsgroup
or something, let me know. I thought perhaps someone had run into the
same trouble.
Thanks,
Chris F.
hoping you guys could help out.
PHP is returning with the error UPLOAD_ERR_INI_ SIZE for all files over
approx. 4Kb. I have set the upload_max_file size to 1Gb, and ini_get()
reports that correctly.
You can run my little sample script here: http://www.paramountlists.com/v3/ftp/cff_test2.php
And now for the script:
<?php error_reporting (E_ALL); ?>
<html>
<head>
<title>Upload </title>
</head>
<body>
<?
if (!empty($_POST['upload'])) {
echo "<pre>";
print_r($_FILES );
echo "</pre><br>";
switch ($_FILES['myfile']['error']) {
case UPLOAD_ERR_OK:
echo "Upload was ok";
break;
case UPLOAD_ERR_INI_ SIZE:
echo "Exceeds upload_max_file size:
".ini_get("uplo ad_max_filesize ");
break;
case UPLOAD_ERR_FORM _SIZE:
echo "exceeds the MAX_FILE_SIZE." ;
break;
case UPLOAD_ERR_PART IAL:
echo "The uploaded file was only partially uploaded.";
break;
case UPLOAD_ERR_NO_F ILE:
echo "No file was uploaded.";
break;
case UPLOAD_ERR_NO_T MP_DIR:
echo "Missing a temporary folder.";
break;
case UPLOAD_ERR_CANT _WRITE:
echo "Failed to write file to disk";
break;
default:
echo "Unknown File Error";
}
echo "<br>";
}
?>
<form method="post" enctype="multip art/form-data"
action="<?php echo $_SERVER['PHP_SELF'];?>">
<input type="hidden" name="MAX_FILE_ SIZE" value="5000000" >
Upload File: <input name="myfile" type="file"><br >
<input name="upload" type="submit" value="Submit"> </form>
</body>
</html>
If you guys think this would be better asked at the apache newsgroup
or something, let me know. I thought perhaps someone had run into the
same trouble.
Thanks,
Chris F.
Comment