Saturday 19 March 2016

php - Architecture for managing files within a specific web application

I'm using Laravel 4 (with Apache) in order to develop a web application. I need some (technical) advice/solution to design a part of my application.



Here is the context of my problem for this part:



In my web application, I need to store files (images, or videos of 150Mo max) uploaded by different users. A user can share some of his files with others that it will choose. For example:
"I've uploaded image1.png and I would like to share it only with Bob and Alice. If I delete image1.png, this file must still be accessible by Bob and Alice until all of them don't want it anymore (a batch maybe run daily to delete it if no user is linked to this file)".




Questions:




  • For managing uploaded files, I would like to allow a user to upload some files without blocking him. He must be able to browse through all pages of my web application during its uploads and see their status (for example, in a progress bar). How can I do that? Is a PHP script and Ajax would be sufficient? Is this possible with Jquery plugin like jQuery File Upload?

  • To store my files, currently, I'm using a single directory. Also, I use a Mysql database to build the logic around the file management (e.g: "image1.png has been uploaded by me and it's url is currently shared with Alice and Bob. They can download it"). For the moment, it's work fine. Only Alice and Bob can see my file. But I don't know if this a good way for an application that could be grow (in terms of files and users). Is this a good architecture (single directory+database)? or I must use physical directory per user?

  • Could I get any advice around performance and optimization regarding my application?



Any help would be appreciate.

Thanks in advance and sorry for my bad english.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...