Jump to content

Recommended Posts

Hello all,

 

I am designing a dynamic page, where users will log on and be able to list files in a directory. End users are currently able to view a file in their directory. I wish for them to see a list of the files in a container area on the webpage with scroll bars. users should be able to download and save files intuitively. They should be able to tag a file for future action on it or its content (so a database table entry with editable properties).

 

 

Any ideas on how? Let me make a bullet list, I feel the above paragraph may not be so clear,

  • Logged in users should be able to list files in their corresponding directories
  • Logged in users should be able to mark/tag the file for future PHP functionality on it (send via email, add another user's ID to the list of users that can view, modify or send forward

I am looking for a general direction so the design will support a massive amount of users, perhaps 500,000+

 

I would rather develop the solution than implement a packaged solution, but understand that if the work has already been done, no need to develop.

 

Kindest regards to all PHPFreaks!

Link to comment
https://forums.phpfreaks.com/topic/271956-file-management-or-something/
Share on other sites

Well, I can't give you a complete solution, but I can give you some tips.

 

Take things one step at a time.

 

As with any project, start with a plan. Perhaps draw out the basic site structure/database relationships on paper. You may have databases including the users, the website pages, the file links and so on. Where relationships go, you may have some link between the users and the file links to know which files they can access. When you have file links, you can use PHP to retrieve those links and list them out for each user, for example, using a loop and echo "<li>"; echo $link; echo "</li>" is one possible way. You can worry about how it is actually represented later, I generally leave styling to the end once the main structure is set up.

 

Once you've set up some basic functionality, you might then wish to add a user creation section. Of course, a form with required fields, validation and error handling and so on would be useful here. After that, you will want to work on logging in users, perhaps use sessions and cookies to make sure no one accesses anyone else's pages. If you are going to have a massive amount of users, you should also be concerned with what server you will be using and whether it can handle such large amounts of users.

 

You will also need to provide a method to upload files and store them appropriately on your server. If you wish to provide users with the option to alter/send their files, one way of doing it is to provide the receiver with permission to access that file's link (if it is private).

 

Be aware that the suggestions may go on forever for such an open ended question as this, do not expect anyone to give you a detailed guide to building the website just the way you want to. Again, do not tackle the problem as a whole but rather, split the problem into smaller, more easily solvable parts and build on that. Also, if it is a really large project, consider getting a partner or even a team, your work flow should be smoother and you will be able to come up with more ideas. If you plan to do so, get people who will complement your skills, who perhaps do better in some web development aspects than you do, in the end, working with another you isn't what you want.

 

Do some research and experiment, if you have any questions that someone can answer in a realistic amount of time, you'll be able to find more precise answers, good luck! :D

 

Cheers,

Amp

a few more tips:

 

- never trust anything from the client. ($_GET, $_FILES, $_COOKIE, etc..)

- never trust any uploaded file, assume the file does NOT match the file extension it is uploaded with.

- never validate files by the extension.

- keep the directory where the files are stored protected, or above the websites root directory.

- log everything about each files (common sense), but if something goes wrong, you know what went wrong / can fix relatively quickly.

- split up stored files in multiple directories (i use 1000 files per directory), as not to strain your ftp / server.

 

That's all i can think of for now, if i think of more i will add for sure.

 

ps: just recently created a full file management system for my cms.

Edited by RobertP
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.