SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Uploading Documents into Database??

    Just a few queries:

    1/ How do I allow the user to upload word documents into my database?

    2/ Is it possible to then have a page that contains a link to each document in the database? Then when the user clicks a link the relevant word doc opens.

    OR is there an easier way to do number 2? Could all the docs in the db be displayed in a select menu?

    I would really appreciate any help. Thanks.

    Kevin.

  2. #2
    SitePoint Zealot swiftone's Avatar
    Join Date
    Mar 2005
    Location
    Sunny Florida
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Inserting into an object into a database as a BLOB file is not something that I would recommend. You are better to save some info about the file (filename.doc) in the database field, then store the file somewhere in your file system directory (/documents/filename.doc).
    Then you could do a repeat region based on a query from the database and link to the filename.doc that you stored that points to the directory that the file was dumped into.
    Doing it this way would also allow you to do a listing of the directory contents without hitting the database if you so wished.
    Happy Coding,
    Swiftone

    Unique Web Sites

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well basically my client wants users to be able to upload assignments in word format into the database.
    Then the admin wants to be able to view each uploaded file in the original word format.

    How can I do this??

  4. #4
    monitormensch oerdec's Avatar
    Join Date
    Sep 2004
    Location
    Hamburg
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yesterday I was playing around with storing MP3 files in a database. This sources helped me to unterstand how it works.

    Uploading, Saving and Downloading Binary Data in a MySQL Database
    Blobbing Data With PHP and MySQL
    MySQL Reference Manual :: 11.4.3 The BLOB and TEXT Types

    Read the comments of Terri irving and Kieran Leigh.

    Good luck,

    oerdec


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
  •