PHP read from uploaded text file?
问题 If I upload a text file via a form, is it possible to output its contents directly from the $_FILES variable rather than saving it onto the server first? I know this is a security risk, but it will only be run on a local machine. Any advice appreciated. Thanks. 回答1: The file is saved to temp directory the moment it's uploaded, but you can use $_FILES['uploadedfile']['tmp_name'] to read it without having to save in a permanent place. 回答2: Doing file_get_contents($_FILES['uploadedfile']['tmp