views:

25

answers:

1

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!

+3  A: 
unlink($_FILES["txt_file"]["tmp_name"]);
Bruce Armstrong
documentation is also his friend: http://www.php.net/manual/en/features.file-upload.post-method.php
prodigitalson