file manager

Hi

In my application ,There are three types of files upload:

1- upload articles

2-upload Images(Gallery)

3-upload files for administrator

The files are stored in the file system and the file information(such as name,type,path,…) is stored in the database.

File model is used to managing files in application(articles,images,…)and the file information(such as name,type,path,…) is stored in the tbl.

What is the best approach to implement a file system?

1-file data storage model is each model in same table,separately.

Example:

article files information stored to articles model’s table.

Image files information stored to Image model’s table.

and just file uploade handle with file class.

2-All files information of models(articles,image,…)storage in file model’s table .Also, all files are managed by class File.