Hi, I have uploaded some files to my database and I want to retrieve the files again. No problem. The next step is to open word if the file is a word document and have the extension .doc and so on.
I can create a new word document but I can't open word with the file I got in my database. My script is like this:' <?php // getdata.php3 - by Florian Dittmer <[EMAIL PROTECTED]> // Example php script to demonstrate the direct passing of binary data // to the user. More infos at http://www.phpbuilder.com // Syntax: getdata.php3?id=<id> if($id) { // you may have to modify login information for your database server: @MYSQL_CONNECT("myserver","think", "secret"); @mysql_select_db("binary_data"); $query = "select bin_data,filetype from binary_data where id=$id"; $result = @MYSQL_QUERY($query); $data = @MYSQL_RESULT($result,0,"bin_data"); $type = @MYSQL_RESULT($result,0,"filetype"); Header( "Content-type: $type"); $word = new COM("word.application") or die("Unable to instanciate Word"); print "Loaded Word, version {$word->Version}\n"; //bring it to front $word->Visible = 1; //echo $data; }; ?> Regards and thanks' Allan -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php