I am developing a web application that will manage directories and files through its web interface.
Developing a web interface is one part, and it is in advanced progress. However, I start thinking, how should I develop the server application, that will manage the files and directories based on user input.
The client will be created using standard tools:
- HTML5
- CSS3
- JavaScript
- PHP – Despite it is server side application, it will be responsible mostly for Dynamic Websites
- MySQL – Despite it is server side application, it will be responsible mostly for keeping information about users, their settings, etc..
Would you advise me please, what would be a server-side programming language of choice to manage server-side file system? Is there any API available, that will allow me to do exactly what I wish? Is it possible to manage the server-side file system in server-side JavaScript, or should I chose another tool? Server-side JavaScript comes to my mind as a logical chocie, as I use it for the client side as well.
This is what I wish to achieve:
- To create new directories and files
- To delete directories and files
- To track the directory and file size
- To move files between directories
- To provide content of the directories and subdirectories
Ideally, the solution should be platform independent and should work on both, Linux Ubuntu and Windows Server OS.
I understand that my question is a bit broad. I would be thankful, if you point me to the right direction, which technologies to start studying, to be able to accomplish the above mentioned.
Thank you.
You already have a very capable serverside language in your list. PHP.
PHP can do all of the things you listed above… and a few you didn’t list as well 🙂
New files can be created with the
touch()function, and new directories with the [mkdir()](http://php.net/manual/en/function.mkdir.php function.Deletion is done with
rmdir()andunlink().File sizes can be monitored using the
filesize()function. Couldn’t find a native folder size function but this Stack Overflow post may be useful – https://stackoverflow.com/a/478161/558021Moving files and directories can be accomplished by using the
rename()function.One of the functions PHP gives us to scan folders is called
glob()it glob – it allows you to find pathnames matching a pattern, so if you give it a wildcard character*it will find all the files in a certain location.