I'm trying to create a local php script that lets the user select a file, then outputs the file contents. I don't want to save the file anywhere, just read its contents. I've been reading guides on file input types and this is the examples I'm seeing:
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
My question is, since I don't want to upload the file anywhere, just read it's contents (this script is personal and runs locally so I'm not worried about security), is there a way to extract the file contents from the file selected in the <input type="file">
without putting this in a form? I'm new to this stuff and want to make it as simple as possible to just read the file's content.