Should I store a file in a database for processing?

Discussion in 'Databases' started by Imozeb, Mar 28, 2010.

  1. #1
    I have a database that will act as an intermediator between users uploading files and the files actually appearing on my site. Is it a good idea to store the files in a database temporarily until they are verified and then put them in a seprate folder, not in the database?

    It looks like this:

    User uploads file --> PHP verifies file name and type --> File is stored in database --> File is verified by moderators --> File is uploaded to folder and deleted from database

    Is this a good idea or will it pose a security risk or useless heavy data transfer?

    Thanks.

    ~imozeb :)
     
    Imozeb, Mar 28, 2010 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    This would create a huge amount of unnecessary overhead for the database. Ideally, I would upload the file to a temporary folder with the location stored in the database. After the file is verified copy it to the perminant location and delete the temp.
     
    jestep, Mar 29, 2010 IP
  3. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Okay. Thanks for your advice!
     
    Imozeb, Mar 29, 2010 IP