RE: Files stored in mysql

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

 



Assuming you make your users log in, you could simply limit the display to the users folder/clients...ie use a rep_id (or whatever you call it) as the main folder name. Then simply start reading the folder contents based on the rep_id folder being the base folder.

Note that the folders and pdfs should be stored off the web root to prevent others from accessing them and poking thru your [potentially] sensitive client data. At the very least consider using .htaccess to limit access to just the web user (the apache (assuming apache) user from inside the network only)


...another option might be to store all the pdfs in one folder and store the ownership (ie client name, who the sales rep is etc) in a table and show the results from the table.

Table structure

record_id
rep_id
client_id
pdf_name

When the user logs in, store the user_id (equal to rep_id in the above example table) in a session and only show the data associated with that user. You will also need to map the rep_ids to sales_manager ids so sales managers or senior management can see the reports as well


There are many ways to skin this cat, but it'll still taste like chicken

Bastien

From: "Vincent Lape" <vinny@xxxxxxxxxxxxxxxxxx>
Reply-To: <vinny@xxxxxxxxxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Subject:  Files stored in mysql
Date: Wed, 17 Aug 2005 12:18:56 -0400

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