are you doing this with a file uploader to check what someone is uploading, like with the copy function, cuz if you are, you can use the
$uploadedfile_name
$uploadedfile_type
$uploadedfile_size
to get the mime type, real file name, and the size to check