fileSystem Library - ArnyminerZ/CNCPi GitHub Wiki
This is the library used by the cloud, which is contained in the file fileSystem.php.
Specify method with ?o=[method]
This is for creating a directory
You have to specify the parameter d, for the name of the directory to create.
ex: /fileSystem.php?o=MKDIR&d=My+Great+Folder
This is for removing a directory
You have to specify the parameter d, for the name of the directory to remove.
ex: /fileSystem.php?o=RMDIR&d=My+Old+Folder
This is for renaming a directory
You have to specify the parameter d, for the name of the old directory name.
And the parameter n, for the new name.
ex: /fileSystem.php?o=RN&d=My+Old+Named+Folder&n=My+Brand+New+Folder
This is for removing a file
You have to specify the parameter f, for the name of the file to remove.
ex: /fileSystem.php?o=RM&d=My+Old+File
This is for renaming a file
You have to specify the parameter f, for the name of the old file name.
And the parameter n, for the new name.
ex: /fileSystem.php?o=RN&d=My+Old+Named+File&n=My+Brand+New+File
This is for compressing and downloading a file or folder
You have to specify the parameter c, for the name of the file or directory to compress.
And the parameter r, for the name of the compressed file (add at the end .zip).
ex: /fileSystem.php?o=COMPRESS&c=Downloadable+Folder&r=Compressed+Folder.zip
This is for uploading files
You need to redirect from a form with a file picker with name fileToUpload, this form need to have the method post, and the action url must be set to fileSystem.php?o=UPL_FILE.
form ex: <form method="post" action="fileSystem.php?o=UPL_FILE"><input type="file" name="fileToUpload" /><button type="submit">Upload</button</form>
This is an optional parameter, if you specify this, _$SESSION["tab"] will be set to the number you specify. This is used by the main web page, for selecting a specific tab page.
ex: &tab=1
This is an optional parameter, if you specify this, after doing the operation specified, you will be redirected to the specified page.
ex: &returnTo=index.php