Bunkai.Satori
Bunkai.Satori

Reputation: 4758

Managing ServerSide FileSystem through Web Application

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:

  1. HTML5
  2. CSS3
  3. JavaScript
  4. PHP - Despite it is server side application, it will be responsible mostly for Dynamic Websites
  5. 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:

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.

Upvotes: 0

Views: 296

Answers (1)

Lix
Lix

Reputation: 47966

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 :)

To create new directories and files

New files can be created with the touch() function, and new directories with the [mkdir()](http://php.net/manual/en/function.mkdir.php function.

To delete directories and files

Deletion is done with rmdir() and unlink().

To track the directory and file size

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/558021

To move files between directories

Moving files and directories can be accomplished by using the rename() function.

To provide content of the directories and subdirectories

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.

Upvotes: 1

Related Questions