<?php
$fileinfo = $_FILES['title'];
if ($fileinfo['type'] !== 'image/jpeg' || $fileinfotype['size'] >= 1024*1024){
echo "Wrong file!";
}
else {
move_uploaded_file($fileinfo['tmp_name'],$fileinfo['name']);
}

?>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="title"/>
<input type="submit" name="submit" value="Submit"/>
</form>