Re: Files stored in mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is one way to do it.  It happens to be the way that I use for a group
of folks that have authentication levels of access to pdf.

I store all of the pdf files above the www folder.  This keeps them out of
prying eyes.  You of course could store them in a database.

the security levels for the pdf are in the name of the pdf itself.  Such as:

thomas_korea_2_General-Travel-Info.pdf

where "thomas" is a group of people getting access to the files.
where "korea" is a particular region of their responsibility
where "2" is the security level that the "thomas" group must have to "see"
this file.
where "General-Travel-Info" is the "public or displayed name for the file.

Now here is how it works, the user logs in.  A session records his group and
his security level which is stored in a users database.  Once authentication
is done, the dir of pdf files is read and exploded on the underscores.
Every file that fits this user (group and security level) is displayed with
the public name with the hyphens replaced with spaces -- such as "General
Travel Info"

That data is displayed as a link which when clicked reads the real file out
to the browser such as

header("Content-Type: application/pdf");
header("Content-Disposition: inline; filename=$file_access_name");
@readfile("$file_access_name");

.

This is one way to do it.  Of course you may want to read the files out of
the database in your case.

Mark Cain


----- Original Message -----
From: "Vincent Lape" <vinny@xxxxxxxxxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Sent: Wednesday, August 17, 2005 12:18 PM
Subject:  Files stored in mysql


> I need some advise on how to handle some pfd files. We have sales guys out
> in the field and generally need to access client reports regularly. I was
> thinking about making a dir for each rep, subdir for each client and
posting
> the pfd files there.
>
> After the reps auth from the login page I call an iframe depending on the
> user:
> <?php if($row_get_user['username'] ==rep1) print '<iframe id="User"
> name="Userss" src="repdata/rep1/dlist.php" width="100%" height="100%"
> scrolling="AUTO" frameborder="1" marginwidth="0"
> marginheight="0"></iframe>'; ?>
>
> <?php if($row_get_user['username'] ==rep2) print '<iframe id="User"
> name="Userss" src="repdata/rep2/dlist.php" width="100%" height="100%"
> scrolling="AUTO" frameborder="1" marginwidth="0"
> marginheight="0"></iframe>'; ?>
>
> This is going to be a pain later when we get all the guys stuff online.
The
> iframe calls dlist.php which will display all the data in a directory.
>
> There has got to be a better way to handle this. How would I go about
> storing the pdf files in mysql and printing all the files in a nice linked
> table do onclick of filename it will open the pfd file to read?
>
> Any help would be greatly appreciated.
>
> P.S. sorry about the read request in my last post
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux