Hello! I'm looking for a way to insert a Word doc (or openoffice doc, if possible) into a MySQL database field, and take the name of the file and put it into another field (in PHP). Has anyone ever done this before? I'd also like to regenerate the Word file if the person says they want to download it once again. Thanks in advance for help!
in your db create a column as a BLOB, read the content of your .doc and put it in that BLOB field $a=file_get_contents("myfile.doc"); mysql_query("INSERT INTO `mydb` (`filename`, `content`) VALUES ('myfile.doc', '$a')"); to show it further to a user, you have 2 options: as a downloadable file or as a page content fore each of those options you will have to define a corresponding HTTP header of the page. You may look it up on the web what kind of headers to put in an HTML file to make it either force download the .doc file or to make it show as an on-page content (if the visitor has the corresponding application to show that content, in this case MsWord or equivalent) good luck
oh, that's simple! Do you know the correct way to remove the extra tags that word puts in there by default? I think it's like <MS:Word> at the top and some stuff like that. thanks!