File Upload Craziness

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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_filesize to 1Gb, and ini_get()
reports that correctly.

You can run my little sample script here:

And now for the script:

<?php error_reporting (E_ALL); ?>
if (!empty($_POST['upload'])) {
    echo "<pre>";
    echo "</pre><br>";

    switch ($_FILES['myfile']['error']) {
        case UPLOAD_ERR_OK:
            echo "Upload was ok";
        case UPLOAD_ERR_INI_SIZE:
            echo "Exceeds upload_max_filesize:
        case UPLOAD_ERR_FORM_SIZE:
            echo "exceeds the MAX_FILE_SIZE.";
        case UPLOAD_ERR_PARTIAL:
            echo "The uploaded file was only partially uploaded.";
        case UPLOAD_ERR_NO_FILE:
            echo "No file was uploaded.";
        case UPLOAD_ERR_NO_TMP_DIR:
            echo "Missing a temporary folder.";
            echo "Failed to write file to disk";
            echo "Unknown File Error";
    echo "<br>";
<form method="post" enctype="multipart/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>

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.

Chris F.

Re: File Upload Craziness

Quoted text here. Click to load it

Finally figured it out after another day of messing with settings ...
apparently you can't set the upload_max_filesize to 1G it has to be in
M, so 1024M I guess.

Site Timeline