0

Is it possible to achieve the following:

  1. Allow a user to upload a text file via HTML form (.txt)
  2. Use the contents of that file in a PHP script to temporarily access the information
  3. Delete any traces of the temporary file after the script has processed?

Think of it as uploading a word document via html form, have a php script as basic as:

<?php

$document = file_get_contents("uploaded_document.txt");

echo $document;

$document = "";

?>

Thank you ahead of time!

1
  • Yes, this is possible. What exactly is your question? Are you aware of the examples in PHP's manual's Handling File Uploads? Commented Oct 28, 2010 at 20:35

1 Answer 1

3
unlink($_FILES["txt_file"]["tmp_name"]);
Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.