Jump to content

ozrhod

Recommended Posts

Hi PHPfreakers,

 

I have an intranet that users upload files to.

 

When they upload a file it renamed the file to a GUID string and then stores this in a mySQL db (the db also allows for permissions and file sharing - via the intranet webpage).

 

Now, however, I want to make it so I can get to my files (or ones I have permission to) from My Computer (or the UNIX/Mac/Linux equivalent).

 

I'm learning about webDAV at the moment and thought of this as a potential solution, however I am running into a problem becaause all the files are in one directory, not one firectory per user.

 

Any ideas what I can do? How I can make this work better?

 

Oh, FYI - http://code.google.com/p/sabredav/ this is the library I have been looking at using because of its support for mySQL permissions and PHP library.

 

Hope someone can help :)

Link to comment
Share on other sites

 

As far as I can tell (and please correct me if I am wrong) this will not let me filter files based on a mysql db - i.e., wont be able to achive listing just the files for the specific user and not list ALL the files in the directory.

 

To explain better, this is the setup:

 

root/files -- in this directory ALL user upload files are stored, not in subfolders, they all go straight into this directory with a new name (GUID string).

tbl_files -- stores copy of the userid and guid to allow access and listing on intranet webpage (mydomain.com/intranet/files).

 

At the moment lib_files.php restricts access to the files in root/files -- how can I do this with webDAV? When all files come from one folder (no subs) and permissions are in mySQL db?

Edited by ozrhod
Link to comment
Share on other sites

Well, do they login to the webdav?

 

A simple yes or no.

 

If they do, then it's quite easy to send back only the files they have access to.

 

SELECT files.*
FROM users_files
JOIN users ON users_files.user_id = users.user_id
JOIN files ON users_files.file_id = files.file_id
WHERE users.user_id = ?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.