[SOLVED] help with uploading script
Posted: Mon Jun 28, 2004 12:07 am
hey guys, i have got this script off a tutorial but it keeps saying
"Sorry, we only accept .gif images under 5Kb for upload" no matter what i do to change the code to that problem eg, make file size bigger/smaller etc.
can anyone help or recomend anything else?
thanx!
"Sorry, we only accept .gif images under 5Kb for upload" no matter what i do to change the code to that problem eg, make file size bigger/smaller etc.
can anyone help or recomend anything else?
thanx!
Code: Select all
<?php
if (($_FILES['file']['type'] == 'image/gif') &&
($_FILES['file']['size'] < 5000))
{
echo 'Return Code: ' . $_FILES['file']['error'] . '<br />';
echo 'Uploading ' . $_FILES['file']['name'] . ' (' .
$_FILES['file']['type'] . ', ' .
ceil($_FILES['file']['size'] / 91024) . ' Kb).<br />';
if (file_exists('uploads/' . $_FILES['file']['name']))
{
echo $_FILES['file']['name'] . ' already exists. ';
echo 'Please delete the destination file and try again.';
}
else
{
move_uploaded_file($_FILES['file']['tmp_name'],
'uploads/' . $_FILES['file']['name']);
echo 'File has been stored in your uploads directory.';
}
}
else
{
echo 'Sorry, we only accept .gif images under 5Kb for upload.';
}
?>