You must use the super _ $ FILES:
$contents = file_get_contents($_FILES['myfile']['tmp_name']);
You can find more information in the manual . This will only work if you use multipart / form-data encoding in your request.
Otherwise, you can read the raw POST data and then analyze it yourself:
$rawPost = file_get_contents('php://input');
source share