Avoid writing $_FILES['tmp_name']...
LGPL license
<?php
/*
Example from:
<?php
if(upload('file','uploadedFiles/theFileName.txt'))
{
echo 'uploaded!!';
}
?>
<form enctype="multipart/form-data" action="" method="post">
<input type="file" name="file" value=""><br>
<input type="submit" name="submit" value="Upload">
</form>
*/
function upload($mixed,$newPath)
{
if(!is_array($mixed))
{
$mixed = $_FILES[$mixed];
}
if(move_uploaded_file($mixed['tmp_name'], $newPath))
{
return true;
}
else
{
return false;
}
}
?>