The Files & Folders section provides APIs for managing files and folder structures.
It supports creating, reading, updating, and deleting files and folders, as well as listing and organizing their contents.
These operations enable structured document storage and file management within the application.
createFolder (Android, Windows, iOS) #
Creates a new folder within a workspace directory and returns the value true if successful.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the create folder is successful, false otherwise.
*/
function createFolder(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| folder | true | string | folder name |
Example :
const arg = {
"folder": "final"
};
const isSucess = createFolder(arg);
createFolders (Android, Windows, iOS) #
Creates multiple new folders within workspace directory and returns the value true if successful.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the create folders is successful, false otherwise.
*/
function createFolders(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| folders | true | JSON Array | Array of folder names |
Example :
const arg = {
"folders": ["final","temp"]
};
const isSucess = createFolders(arg);
deleteFolder (Android, Windows, iOS) #
Deletes the specified folder within workspace directory along with all files and subfolders it contains.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the delete folder is successful, false otherwise.
*/
function deleteFolder(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| folder | true | string | Folder name |
Example :
const arg = {
"folder": "final"
};
const isSucess = deleteFolder(arg);
deleteFolders (Android, Windows, iOS) #
Deletes the specified folders within workspace directory along with all files and subfolders they contain.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the delete folders is successful, false otherwise.
*/
function deleteFolders(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| folders | true | JSON Array | Array of folder names |
Example :
const arg = {
"folders": ["final","temp"]
};
const isSucess = deleteFolders(arg);
deleteFile (Android, Windows, iOS) #
Deletes the file specified by the input file path and returns true if the operation is successful.
If the channel parameter is provided, the file is deleted from the specified channel.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the delete is successful, false otherwise.
*/
function deleteFile(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Path to the target PDF file within the workspace. |
| channel | false | string | Channel name |
| call | false | string | Callback function name |
Example :
const arg = {
"file": "Test1.pdf",
"channel": "MyDocuments",
"call" : "onDelete"
};
deleteFile(arg);
/**
* callback function for deleteFile
*
* @param {string} res - The response string to be parsed as JSON.
*/
function onDelete (res) {
const result = JSON.parse(res);
}
Result example :
{
"parameter": {
"status": "OK",
"message": "",
"data": true
}
}listDir (Android, iOS) #
Creates a JSON array containing the list of files in the specified folder.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {Object} - Returns JSON Array of files in the folder
*/
function listDir(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| folder | true | string | Folder path within workspace dir |
Example :
const arg = {
"folder" : "/pdf"
};
const result = listDir(arg);
Result example :
[
{
"name": "Test1.pdf",
"path": "/pdf/Test1.pdf",
"length": "25605"
},
{
"name": "Test2.pdf",
"path": "/pdf/Test2.pdf",
"length": "25605"
}
]copy (Android, Windows, iOS) #
Copies a file to the specified folder.
Note: This function works only within the wizard workspace. To move a file to a local channel, use the saveToLocalChannel function instead.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the copy is successful, false otherwise.
*/
function copy(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Path to the file within the workspace. |
| folder | true | string | Destination folder name |
Example :
const arg = {
"file": "pdf/Test1.pdf",
"folder": "final",
};
const isSucces = copy(arg);saveToLocalChannel (Android) #
Saves a file to a local channel directory (in settings labeled as a “Browse device storage”).
/**
* @param {Object} arg- Parameter JSON object.
* @returns {void}
*/
function saveToLocalChannel(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| path | true | string | Path to the file within the workspace. |
| name | true | string | File name |
| channel | true | string | Local channel name |
| call | true | string | Callback funkcion name |
| data | false | string | Additional file metadata |
Example :
const arg = {
"path" : "/pdf/Test1.pdf",
"filename" : "Test1.pdf",
"channel" : "Samples",
"call" : "onSave"
};
saveToLocalChannel(arg);
/**
* callback function for saveToLocalChannel function
* @param res - result in string format
*/
function onSave(res) {
const result = JSON.parse(res);
}Result example :
{
"parameter": {
"data": {
"filename": "Test1.pdf",
"path": "/data/user/0/com.anasoft.signatus.app/files/WorkSpace/pdf/Test1.pdf"
},
"status": "OK",
"message": "File saved"
}
}move (Android, Windows, iOS) #
Moves a file to the specified folder.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the move is successful, false otherwise.
*/
function move(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Path to the file within the workspace. |
| folder | true | string | Destination folder name |
Example :
const arg = {
"file": "pdf/Test1.pdf",
"folder": "final",
};
const isSucces = move(arg);rename (Android) #
Changes the name of the defined file.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the rename is successful, false otherwise.
*/
function rename(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| path | true | string | Path to the file within the workspace. |
| name | true | string | New file name |
Example :
const arg = {
"path": "pdf/Test1.pdf",
"name": "Renamed.pdf",
};
const isSucces = rename(arg);saveText (Android, Windows, iOS) #
Creates a text file containing the text passed in as a string.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the save is successful, false otherwise.
*/
function saveText(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Path to the text file within the workspace. |
| text | true | string | Text file content |
Example :
const arg = {
"file": "/text/testFile.txt",
"text": "Test text content",
};
const isSucces = saveText(arg);loadFile (Android, Windows, iOS) #
Reads a text file and returns it as a String.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {string} - Returns text file content
*/
function loadFile(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | File path within workspace dir |
Example :
const arg = {
"file" : "/text/testFile.txt"
};
const text = loadFile(arg);
filesToJson (Android, iOS) #
Reads the specified binary files and converts them into a single JSON file containing the Base64-encoded contents of each source file. This is useful for integrations where only one JSON file can be transmitted.
/**
* @param {Object} arg- Parameter JSON object.
* @returns {boolean} - Returns true if the create is successful, false otherwise.
*/
function filesToJson(arg);Parameters description :
| Name | Required | Format | Description |
|---|---|---|---|
| file | true | string | Path to the target json file within the workspace. |
| list | true | JSON Array | Array of JSON Objects with attributes respective to each source file |
| list.path | true | string | Path to a source file within the workspace |
| list.name | true | string | Name to identify the file in the resulting JSON |
| list.id | false | string | Unique id of source file |
const arg = {
"file": "base64.json",
"list": [
{
"name": "Test1",
"path": "/pdf/Test1.pdf"
},
{
"name": "Test2",
"path": "/pdf/Test2.pdf"
}
]
};
boolean isSucess = filesToJson(arg);
base64.json example :
[
{
"name": "Test1",
"data" : "YWJjZGVmZ2g="
},
{
"name": "Test2",
"data" : "aWprbG1ub3A="
}
]