<input type="file" name="txt_file" />
| From: | John Taylor-Johnston | Date: | Thu, 06 Mar 2003 00:55:04 +0000 |
| Subject: | <input type="file" name="txt_file" /> | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-138399@lists.php.net to get a copy of this message | ||
Instead of using fread, I want to upload a *.txt file using:
<input type="file" name="txt_file" />
and display it in a textarea. Where do I go now? Specifically, how do I get $contents?
Thanks,
John
<?php
$filename = "/usr/local/something.txt";
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
if
($contents){echo"<form><textarea>$contents</textarea></form>";}
else{echo "no contents there";}
?>