|
Posted by Martin Pφpping on 03/25/06 16:48
Martin PΓΆpping schrieb:
> But now I want the content of my file in the textarea and I am asking
> myself, if this is possible only via HTML and without coding a file
> upload, for example with PHP
If somebody is interested, here is a solution with PHP:
<h1>Upload</h1>
<form
action="<?php echo $PHP_SELF ?>"
method="post"
enctype="multipart/form-data">
<input type="file" name="probe" />
<input type="submit" value="Go!" />
</form>
<hr />
<?php
if (isset($_FILES['probe']) and ! $_FILES['probe']['error']) {
move_uploaded_file($_FILES['probe']['tmp_name'], "./tmp/newfile.txt");
printf("Sie ist %u Bytes groΓ und vom Typ %s.<br />\n",
$_FILES['probe']['size'], $_FILES['probe']['type']);
?>
<textarea cols="50" rows="50"><?include('./tmp/newfile.txt')?></textarea>
<? }
?>
But my question still exists:
Is it possible to show the content of a txt-file in a textarea only with
using HTML?
Bye,
Martin
Navigation:
[Reply to this message]
|