SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    package or script to read in word doc?

    I was just wondering if anyone knew of a premade script or package that would allow me to suck in an uploaded word doc, rip thru it and format it properly to enter into a db?

    Any ideas?

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    could you be a bit more specific?

    what format are you looking to convert it to?

    do you want to store the actual file contents into the database, or save the file to the filesystem, and store the path to that file in the database?

    do you need it to handle the upload(provide an html form, team it with a script to receive the upload etc..), or do you have that part taken care of?

    i dont usually use prewritten scripts, so im not going to be able to recomend any. but maybe someone else can, or we can guide you how to make it yourself. either way this extra info would help us help you.

  3. #3
    is_empty(2); foofoonet's Avatar
    Join Date
    Mar 2006
    Posts
    1,000
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    a couple of ideas

    Quote Originally Posted by dc dalton
    format it properly
    What means?
    as xhtml, text, rtf?

    I know some similarly sounding classes were added to phpclasses.org a few weeks ago, thats where I would look first.
    (you have to register with the site, the classes can be of varied quality, read the licences carefully on each package, sometimes the docs are not in a language you will understand..)

    Otherwise, input wise - for IE only, as a GUI tool TinyMCE (a wysiwg editor) has a "paste from word" function that strips out nasty msxml tags.

    That might be worth disassembling - though that is JS of course.

    If xhtml is your target, then Tidy might help you clean up any errors. www.php.net/tidy
    Upgrading to Mysql 5? Auto-increment fields now strict
    use NULL
    Or zero or leave the field name out completely.

  4. #4
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to read it in, wrap paragraph tags around the paragraphs and then drop it into a db to be used by a website.

    I have everythgin else done, just need to find something to read the file in..

  5. #5
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    you could try using fopen("filename.txt", "r");

    then place it into a varible.

    but i think the database can only handle upto 255 characters per feild. best asking a database guru.

    as for the tags, best way will be to place them in the page already for when you query the database, then place the text between the tags when the page is shown/requested.
    "Don't you just love it when you solve a programming bug only to create another."


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •