Ive been experimenting with the upload capability of php, I have been looking at this tutorial on w3school.
http://www.w3schools.com/php/php_file_upload.asp
The problem of your script is that you are probably trying to upload a file higher that your limit is! You specified a really low max filesize! Print out your $_FILES var to get information about what's wrong ;)
However, in order to move the file to your folder you still need to use move_uploaded_file:
$allow = array("jpg", "jpeg", "gif", "png");
$todir = 'uploads/';
if ( !!$_FILES['file']['tmp_name'] ) // is the file uploaded yet?
{
$info = explode('.', strtolower( $_FILES['file']['name']) ); // whats the extension of the file
if ( in_array( end($info), $allow) ) // is this file allowed
{
if ( move_uploaded_file( $_FILES['file']['tmp_name'], $todir . basename($_FILES['file']['name'] ) ) )
{
// the file has been moved correctly
}
}
else
{
// error this file ext is not allowed
}
}