anushka Posted April 9, 2008 Share Posted April 9, 2008 I am reading .doc file .but i am getting junk value.why i am getting a junk value.Please help me Quote Link to comment Share on other sites More sharing options...
writer Posted April 9, 2008 Share Posted April 9, 2008 ??? I'm afraid you're going to have to be more specific. Quote Link to comment Share on other sites More sharing options...
NikkiLoveGod Posted April 9, 2008 Share Posted April 9, 2008 I havent personally tried reading a .doc file, but I really suggest that you'll change the .doc to a .rtf, .txt, or other unformatted text file. The junkdata you are getting MIGHT be the .doc files other 'non relevant' information, such as formatting, columns, colors, indentation and so on. If this didn't help, post a bit more information. Good luck! Quote Link to comment Share on other sites More sharing options...
anushka Posted April 9, 2008 Author Share Posted April 9, 2008 this the code which i have written to read the file called abc.doc,But i am not able to read the content which is there in the file abc.doc <?php $fp = fopen("abc.doc", "rb"); $text = fread($fp,1024); echo $text; ?> Quote Link to comment Share on other sites More sharing options...
unsider Posted April 9, 2008 Share Posted April 9, 2008 .doc is not an acceptable format, it would be best to use .txt or .rtf for PHP Quote Link to comment Share on other sites More sharing options...
anushka Posted April 9, 2008 Author Share Posted April 9, 2008 can i convert .doc file to .txt file internally through programing. Quote Link to comment Share on other sites More sharing options...
unsider Posted April 9, 2008 Share Posted April 9, 2008 can i convert .doc file to .txt file internally through programing. I suppose so, but not with a 'language' like PHP, that would require a 'lower-level' language. I'm not qualified to answer that question, but I'm sure it involves a good bit of knowledge. If you can't read the contents of the .doc file I'd suggest looking for alternatives to reading it, or just trying to recreate it on a .txt file (if possible). Either way, .doc is not an acceptable format. Quote Link to comment Share on other sites More sharing options...
writer Posted April 9, 2008 Share Posted April 9, 2008 That's good to know, anushka. Thanks. I wonder if I can stir up any tutorials on converting .doc to .txt behind-the-scenes. If anyone can find one before me, please post it here. It would be pretty useful to allow users to upload .doc's. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted April 9, 2008 Share Posted April 9, 2008 The wonders of google eh: http://drewd.com/2007/01/25/reading-from-a-word-document-with-com-in-php That wasn't hard, was it? Quote Link to comment Share on other sites More sharing options...
writer Posted April 9, 2008 Share Posted April 9, 2008 Nope! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.