I am using a plain text file in a PhP script. Is there any way to process the file in the PhP script without saving it locally? Everywhere I see simply uploading a file and sav
If its text file (assuming size is not that huge) usually you could read it by
$contents= file_get_contents($_FILES['file']['tmp_name']);
If you are not sure which type of upload it was, check the request method
if(strtolower($_SERVER['REQUEST_METHOD'])=='post')
$contents= file_get_contents($_FILES['file']['tmp_name']);
elseif(strtolower($_SERVER['REQUEST_METHOD'])=='put')
$contents= file_get_contents("php://input");
else
$contents="";