Jump to content

Store files in BLOB or in a Directory?


lopes_andre

Recommended Posts

Hi,

 

I'am starting a new project that needs to store files(*.docs and *.pdf)

 

I don't know very well how to deal with these... the files I need to store are confidencial files of users... what the best option to deal with this kind of files? Put the files in a protected directory or store them in the BLOB database field?

 

Best regards,

Link to comment
https://forums.phpfreaks.com/topic/144398-store-files-in-blob-or-in-a-directory/
Share on other sites

Hi andre

 

Just a personal thing, but I would go for storing the files in a directory, BLOBS tend to make the database a bit big and unwieldy in my opinion.

 

Of course, you can always store the NAMES of the files in a database table so you can access the files quickly - but if was me, I'd store the files themselves separately.

 

But that's just me !  - other [more experienced] programmers may have different views.  Good luck !

I think my best option is to store in files/directory. The ammount of informaton is huge...

 

Now a question about store confidencial files in a website on Internet... I don't know very well how to deal with this... There is an tutorial or an example for this kind of situation? What the "strategy" for secure files in a website and don't let all the people see the files?

 

Sorry for this questions, I have never dealed with files...

 

 

Best Regards,

 

 

 

 

Any "Confidential" or "Restricted" files should always be put outside of the public root - that is:

 

Typical SYSTEM path to web server public root:

/home/web/www

Translates to: http://www.some-website.com/

 

The public root being the folder "www", so if you store all your files in "/home/web/securefiles/" no one can access the folder anyway - Apache wont let them, but your php script has no problem serving the file itself, including files, or manipulating them.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.