RE: Big question about databases...
| From: | Nold, Mark | Date: | Thu, 28 Sep 2000 01:04:36 +0000 |
| Subject: | RE: Big question about databases... | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-2828@lists.php.net to get a copy of this message | ||
----------------------------------------------------------------------------
-----------------
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
postmaster@normandy.com.au and delete the email document without making a
copy.
----------------------------------------------------------------------------
-----------------
Nathanael,
I've been doing some work on this myself and you've probably seen my
opinions about using files with just pointers in a DB.
I have a few questions for you and others on this list as to how they would
handle such a document repository.
1. I remember reading somewhere about limits to the numbers of files for a
directory... something to do with node space? We plan to have 1000's maybe
even 10,000 documents stored in our system... any problems with throwing all
these in one directory?
2. To stop name clashing etc we rename the file to its ID number in the
table so that "My Doc.pdf" become 1234 (the original name is stored in the
DB). Plus we also store all the documents out of the web root. To deliver
the file to the user we have deliver.php which sets some headers then does a
readfile() on the file (if the user should be able to access the file). My
problem is that this is a bit flakey (very client dependent) and i would
like to some how set the filename for the file. Any ideas? I currently use..
Header("Content-Disposition: inline; filename='$original_filename'");
Header("Content-Description: Document Repository");
Header("Content-type: $mimetype");
$success = readfile($file);
But this doesnt work all the time... and doesnt work at all for PDF's. One
way to make this more reliable (and i've only tested various MSIE 4 -5.x so
far) is to make the link contain a spurious get var like
deliver.php?id=1234&output=.xls this works more often than not... any body
have any more success further than these ideas?
3. Are there any security traps here... im pretty sure that by readfile() i
dont have to worry about people uploading a .php since it wont run via
readfile.. also since they are out of the webroot noone can find the secret
dir a just grab em (i control the OS security) but any securtiy holes i may
need to be concerned about?
Also Nathanael im not sure what PUT does, im currently using POST.. should i
be interested in PUT?
mn
-----Original Message-----
From: Camelot, Nathanael (N.) [mailto:ncamelot@visteon.com]
Sent: Wednesday, September 27, 2000 11:44 PM
To: 'php-windows@lists.php.net'
Subject: Big question about databases...
Hi all, here I am with a big question :
On a Windows NT, Apache 1.3.12 & php4.01 intranet server, I need to have
people upload files (pdf, xls, doc, jpeg...) (not more than 1Mo. each one)
What do you all think is better :
- Files are uploaded into a directory and I store filenames, paths
... in a database
- Files are uploaded into the database, via BLOBs ?
I think about putting datas into a directory, knowing my serveur isn't a
killing supercalculator...
Most of times the files will be downloaded, only a few people will a have a
"PUT" right .
Any answer would be appreciated.
Nathanael
"Artificial intelligence is nothing compared to natural stupidity"
Someone