fileSystem Library - ArnyminerZ/CNCPi GitHub Wiki

This is the library used by the cloud, which is contained in the file fileSystem.php.

FileSystem Library

Specify method with ?o=[method]

MKDIR

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

RMDIR

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

RNDIR

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

RM

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

RN

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

COMPRESS

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

UPL_FILE

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>


tab

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

returnTo

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

⚠️ **GitHub.com Fallback** ⚠️