Storing Files in MYSQL Database

Discussion in 'PHP' started by shehzad.asghar, Jun 7, 2008.

  1. #1
    I am working on an extensive Real Estate Application in PHP/MYSQL and want to store files in the MYSQL DB to maintain security of the documents.

    Can anyone tell me how reliable is it is storing those files in DB and what effect it will have in application performance.
     
    shehzad.asghar, Jun 7, 2008 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    Don't store files in the database, but a link to an unique file wich contains the document. Set the right CHMOD permissions to only allow the script to use the file!


    Why not storing files in database; a database isn't build for storing files, and searching will be less powerfull!

    Harddisk = for files
    Database = for records linking to files, and so on!
     
    EricBruggema, Jun 7, 2008 IP
  3. shehzad.asghar

    shehzad.asghar Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    But in the case that my application is installed on a windows environment so what will be the case.

    CHMOD will not work
     
    shehzad.asghar, Jun 7, 2008 IP
  4. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #4
    Just hold the files somewhere that is not accessible via the web.

    In a cPanel environment an example would be above the public_html directory, possibly in a folder called 'files'.

    Dan
     
    Danltn, Jun 7, 2008 IP