2MB limit on uploads

Hi there, I have created a simple upload form on a pretty vanilla LAMP installation running on a fedora 16 VM. I have set “file_uploads” to “on” and “upload_max_filesize” to “200M” from its original “2M” setting (my phpinfo() confirms this)

however, whenever I try to upload anything over 2M, it uploads a blank file with the correct name. under 2M works like a dream …are there any other settings i should be setting anywhere to get this to work ?

my simple scripts is

<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);

$thisfile = $_SERVER['PHP_SELF'];

$message = '
<form enctype="multipart/form-data" method="post" action="'.$thisfile.'">
<input type="file" name="file" />
<br />
<input type="submit" name="submit" value="submit" />
';

if (!isset($_POST['submit'])) {
    echo $message;
} elseif ($_POST['submit'] == 'submit') {
    $uploaddir = '/var/www/html/uploads/';
    $uploadfile = $uploaddir . basename($_FILES['file']['name']);
    if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
        echo "File move worked";
    } else {
        echo "File Move hasnt worked";
    }
} else {
    $message = 'Damn it';
    echo $message;
}
?>

Like I say, the script works fine, just something is stopping it from uploading greater than 2M

any help our guidance would be greatly appreicated

Gary

Did you restart the apache server?

It’s a file size limitation set in your php.ini file.

Are you working on a hosting provider’s server, or your own server?

From the Original Poster:

Hi there, I have created a simple upload form on a pretty vanilla LAMP installation running on a fedora 16 VM. I have set “file_uploads” to “on” and “upload_max_filesize” to “200M” from its original “2M” setting (my phpinfo() confirms this)

interestingly, i have discovered that I can transfer to the php.ini limit from internally (on same network) but when coming in from anywhere in the internet its 2M only …could this be an apache setting as opposed to being a php one?

You may need to change the post data size in the php.ini file as well it needs to be greater than the 200M set for max allowed file size e.g 210M. Cheers

Why you don’t enable display errors & log errors? Paste it on this topic