lopes_andre Posted February 8, 2009 Share Posted February 8, 2009 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 More sharing options...
corbin Posted February 8, 2009 Share Posted February 8, 2009 http://www.phpfreaks.com/forums/index.php/topic,237739.0.html Might pertain to your interests. Link to comment https://forums.phpfreaks.com/topic/144398-store-files-in-blob-or-in-a-directory/#findComment-757751 Share on other sites More sharing options...
grissom Posted February 8, 2009 Share Posted February 8, 2009 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 ! Link to comment https://forums.phpfreaks.com/topic/144398-store-files-in-blob-or-in-a-directory/#findComment-757752 Share on other sites More sharing options...
lopes_andre Posted February 8, 2009 Author Share Posted February 8, 2009 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, Link to comment https://forums.phpfreaks.com/topic/144398-store-files-in-blob-or-in-a-directory/#findComment-757789 Share on other sites More sharing options...
printf Posted February 9, 2009 Share Posted February 9, 2009 Just use a simple htaccess file to protect the directory with the files and serve them with PHP header() and readfile() functions... Link to comment https://forums.phpfreaks.com/topic/144398-store-files-in-blob-or-in-a-directory/#findComment-757794 Share on other sites More sharing options...
uniflare Posted February 9, 2009 Share Posted February 9, 2009 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. Link to comment https://forums.phpfreaks.com/topic/144398-store-files-in-blob-or-in-a-directory/#findComment-757827 Share on other sites More sharing options...
corbin Posted February 9, 2009 Share Posted February 9, 2009 Some cheap shared hosting doesn't allow access above the web root. Link to comment https://forums.phpfreaks.com/topic/144398-store-files-in-blob-or-in-a-directory/#findComment-757870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.