Hi, I'm using this script to allow users to be able to upload to my site.
<?php
// check the filesize
if($_FILES['userfile']['size'] > 500000000) // ~50kB
{
echo "Gomen, that file is too big!";
exit;
}
if(is_uploaded_file($_FILES['userfile']['tmp_name']))
{
move_uploaded_file($_FILES['userfile']['tmp_name'],'uploads/'.$_FILES['userfile']['name']);
echo "<img src=\"images/sdmomo.gif\" alt=\"Momo\" align=\"left\">
Upload completed!<br><br>\n Thank You!<br><br>\n <a href=\"javascript:history.go(-1)\">OK</a>";
}
else
{
echo "<b>ERROR</b><br><br>\n
Could not upload your file. Please contact <a href=\"http://www.mzanime.com\contact.htm\">the administrator</a>.";
}
?>
The problem is that it won't let users upload a file bigger than a few megs. Did I do something wrong?? Or does anyone know of a way to override the "upload_max_filesize" configuration?
I'm sure my host would not change it if I asked them to.
One more thing. I know that PHP displays file sizes in bytes... but how does a person read it like this? I'm not even sure what 500000000 is in mb.