I have managed to get this far:
$file_name = $_FILES['uid']['name'];
$ext = pathinfo($file_name, PATHINFO_EXTENSION);
$new_file_name=$user . '.' . $ext;
echo "File Name :".$new_file_name."<BR/>";
echo "File Size :".$_FILES['uid']['size']."<BR/>";
echo "File Type :".$_FILES['uid']['type']."<BR/>";
This works nicely and renames my uploaded file but im struggling to make it accept only jpegs under a certain size. Everything I have tried has resulted in me getting an error message that i can only upload a jpeg (yet the file still gets uploaded) or nothing gets uploaded at all even if it is a jpeg. Any help is most appreciated. thank you.