As far as I know, PHP stores all uploaded files in upload_tmp_dir (or the systems default tmp dir, if upload_tmp_dir is not set in the php.ini file).
Then the usual method is to move that file to another place using move_uploaded_file
My question is: Is there a way to to retrieve the file in a variable? So it does not need to be stored on the file system at any time?
Reasons are, that I don’t have to clean up the files afterwards and don’t have to care about file system permissions.
It is generally safe to leave the temporary file as it is, PHP will take care to delete it at the end of the request (unless PHP crashes hard during your script).