Okay I'm totally new in this field and going through some tutorials and I found that while uploading files in PHP it stores them in a temporary location.
$file_temp=$_FILES['file']['tmp_name'];$file_loc="Upload".$file_name;move_uploaded_files($file_temp,$file_loc);
Now why doesn't PHP allow uploading files directly to the desired location? Why they are stored in a temporary location with a .tmp extension and what benefit do we get from this strategy?