I want to create flex/actionscript directory view for my files with php/mysql. I have some ideas that I want to share:
1)I am thinking of creating table (in mysql) “files” and another table “folders”, when user loges in i will require all data from “files” and “folders” where Username = ‘something’. But the problem is, I will create a lot of entries inside of tables. For example if I will have 100 users, and each user could create 100 entries (files or folders) it means that i will get 10000 entries inside table.
2)My second idea, and I think more safe way of doing it is creating table “users” where will be set id, username, password, … , files, folders. In files (text format entry) will be listed information about files, and they will be dividend by “*” symbol like this:
id*file name*size(in kbytes)*path*status
example:
15*test.exe*150*/root/*private
16*test2.exe*200*/root/folder1/*public
17*test3.exe*5600*/root/folder1/subfolder/*private
...
This info will be outputed when flex once when user loges in, and actionscript will catch it. But the problem is that when i will edit 1 file info (for example 1 file name “test.exe” to “editedtest.exe”) i will load back in mysql all data:
15*editedtest.exe*150*/root/*private
16*test2.exe*200*/root/folder1/*public
17*test3.exe*5600*/root/folder1/subfolder/*private
Now here is only 3 file info but there can be more than 1000.
so what do you think, how can I solve my task? Or is it better way of doing it and I just don’t know about it? Please write your suggestions and thoughts.
I will use the term “filesystem” to represent the file/folders structure for each user.
Do not be afraid of a huge amount of lines in your db, databases are designed to handle this.
Also, i
t provides you many advantages :