on?=
From: [EMAIL PROTECTED]
MIME-Version: 1.0
Cc: 
Return-Path: [EMAIL PROTECTED]
Originating-IP: 213.89.182.213
X-Priority: 3
X-Mailer: DCS.net Webmail ver. 0.1
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Why not use the best part from both !!!

use mysql to store:
  real_file_name   // planning.doc
  file_id          // insert_id .md5(user) or whatever
  owner            //
  group            //
  accessmode       // 0755
  conttype         // application/pdf
 =20
and filesystem to store these files.

All files will be stored in the same folder outside=20
the webroot and r/w only for webuser.

then you can use a php script to get files and send them to browser.

http://www.host.com/getfile.php?file_id=3D123

In getfile.php you can then authenticate the=20
user and determine whether or not to allow=20
reading, delete etc.

and finally:
Header("Content-Type: $db->contentype");

Read the file and output it to user !!!

Another advantage is that You never need to
store files with their own names which means
that there can be many docs in the same dir=20
with name "planning.doc" because these are=20
stored as "file_" . $db->insert_id;

=3Dd0Mi=3D


> I'm trying to find any and all thoughts on whether to store files in the=20
> db (PDF's, word docs etc) or in the filesystem. If I do in the fs then=20
> there is tons of overhead because of new folders, each client having=20
> thier own folder(and subfolders) etc. And then htaccess'ing the dir's=20
> independently along with the overhead of keeping track of the htaccess=20
> files. I admit php has good classes for htaccess stuff, but the=20
> intergration between apache and php security isn't at that level yet.=20
> Right now I'm developing on my own server, but it will be moved to a=20
> hosting co, so I'm not sure if they will have mod_auth_mysql ,probably=20
> not due to the limitations for required settings in the conf file.
>=20
> So I started developing with the htaccess stuff, and am now pondering=20
> the use of the db to store the files, I did some searching and found=20
> several people saying there was a huge discussion on the mailing list=20
> about the middle of 2001, but I've been unable to find it. Does anyone=20
> know where this is? Can anyone throw out a few drawbacks/advantages=20
> other than the ones I'm thinking of?
>=20
> Will anyone elighten me?
>=20
> Thank you,
>=20
> Dan
>=20
> sql, query
>=20
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>=20
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>=20
> 

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to