Question : Handling of PDF image files in a mysql database w/php

I have a directory with plenty of pdf files that I would like to make accesible
to customers.   What would the best approach be to integrate them either
as a BLOB field?    Or as separate files whose filenames are stored on
a table?      The users would be login in with their username and password
to access only their related pdf files, but I would require that a certain user
cannot access other user's pdf files.


Thank you.

Answer : Handling of PDF image files in a mysql database w/php

Move the files to a directory that is outside of the WWW root so you do not risk exposing files to unauthorized clients.  Then write a script that is login-aware and that correlates the files with their owners.  Use this script to present download links.  The design pattern means that clients must login in see their files and cannot see any other files.  It is a fairly significant application development effort, but it is also a good question.

I would not recommend putting BLOB data into your data base.  There are many reasons for this (too much to write into an answer here at EE) so it is best to avoid.

Regards, ~Ray
Random Solutions  
 
programming4us programming4us