Forum Moderators: coopster

Message Too Old, No Replies

loading a word document into a text area

         

neophyte

3:51 am on Aug 27, 2004 (gmt 0)

10+ Year Member



Hello everyone -

Is it possible to do the following with php?

1. display a form which includes a <textarea>
2. press a button on the form that would display a directory dialog box which would allow the user to navigate their local directories and select a word document
3. the contents of the selected word document would be sucked into the text area which - on submit - would then be inserted into a database on the web server.

I've looked at the fopen() function, but that won't open up a directory dialog. I've also read elsewhere that the file chosen needs to be uploaded to the server before it can be displayed in the textarea.

Any guidance greatly appreciated.

Neophyte

henry0

5:17 pm on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may not in 1 shot you need first to open a dir select a file then load that file in a new dir
from then it needs to be red by a flat file that will open the dir
or loaded to a DB and query for

further
MS word is adding a ton of codes that needs to be cleaned

look at any WYSIWYG to find how the MS mess is cleaned before insertion

Here we open a dir find a file and copy it to another destination

$source="/pub/comwww/****x.php";
$dest="/pub/comwww/****x.php";

if (!copy($source, $dest)) {
print ("failed to copy $dest...\n");
}
echo "";
// end of copy file