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
When the form is submitted, check the $_FILES['input_name']['tmp_name']
property. This is the path to your file saved in a temporary /tmp
system path. You can proceed reading the name using, say, file_get_contents()
and then simply forget the file. System will take care of removing it.
Just to stand out of the other answers, you could theoretically read the file without even uploading it using JavaScript, see http://www.html5rocks.com/en/tutorials/file/dndfiles/. Then submit only the data you need as part of AJAX request.