mauserrifle's avatar

Projects for upload file handling (folder strategy)

I am curious whether projects exist for just structuring files using a folder strategy.

So we have packages such as stapler. This is a file upload solution coupled to ORM models.

Personally I don't like these packages with all functionality in one. My application is designed in such away (with repositories) my models are only responsible for saving data in tables. I prefer using packages that were designed for one task. One for uploading, other for resizing them and ORM to keep track of them (simple File model).

For resizing I found Croppa: https://github.com/BKWLD/croppa

Great package. Does what it supposed to do, just resizing :) Next I just need to make my uploading work. I would need to put files in separated folders due performance reasons. For example split them by thousands:

1/ 
   files by id 1 - 1000
2/
   files by id 1000 - 2000

Or just by date:

2015/
    02/
        /01

Anyway, which strategy I use doesn't really matter. What I am now looking for are PHP projects that are designed to handle these folders.

It is no biggie to create a FileManager that does the above. But I am just curious whether there are projects that already do this for us (handle folder structure for file uploads) proving multiple strategies. May be Laravel specific or not.

Anyone know of such a solution? I could not find them.

0 likes
1 reply
SNaRe's avatar

Just check Wordpress' method for handling it. It has been practiced for long years. There is no need to Reinvent The Wheel.

Please or to participate in this conversation.