webanddesigns
06-29-2006, 09:59 AM
We're optimizing our community portal script and revamping the upload method.
We were wondering if database (mysql) upload better than a standard file directory storage upload?
What are the advantages and disadvantages?
Thanks,
Geoff
hyperspin
06-29-2006, 02:10 PM
IMO, file directory method might be better because:
1. It's easier and more efficient (incremental backup is possible) to backup a directory
2. If the DB is corrupted, you may lose everything whereas with file method you probably just lose a few files
3. Less load on DB server since data size is smaller
webanddesigns
06-29-2006, 07:43 PM
IMO, file directory method might be better because:
1. It's easier and more efficient (incremental backup is possible) to backup a directory
2. If the DB is corrupted, you may lose everything whereas with file method you probably just lose a few files
3. Less load on DB server since data size is smaller
Thanks, that was very helpful!
Czaries
06-30-2006, 09:29 AM
What I do is place the important files BELOW the web root, and use a PHP file to read them and serve them to visitors with file_get_contents (http://www.php.net/file_get_contents).
It is much easier to prevent file leeching that way, as the actual download location is never revealed. You can even use mod_rewrite to make it more realistic-looking, like /files/get/blah.zip really points to a PHP file /file.php?file=blah.zip which reads from a directory below the web root. It works very well!