Hubitat provides an interface for app developers to create/upload, delete, download, and list File Manager files.
NOTE: This information is for developers. End users looking for information how to use File Manager should consult the File Manager documentation.
void deleteHubFile(String fileName): deletes the supplied file name (Since 2.3.4)byte[] downloadHubFile(String fileName): returns a byte array containing the contents from the supplied file name, or null if the file is unavailable (Since 2.3.4)List getHubFiles(String folder = ""): lists the files and folders in File Manager (folder since 2.3.7)
folder - Optional; the relative path of the folder to list. Defaults to the File Manager root.List with one entry for each file or folder. Each entry has these properties, all Strings:
id - a numeric ID for the entrytype - "file" or "dir"name - the name of the file or foldersize - the size in bytes, or "0" for a folderdate - the modification time, in milliseconds since the Unix epoch (not present for a folder)void uploadHubFile(String fileName, byte[] bytes): uploads (creates or overwrites) the supplied file name with the supplied byte array content (same format retrieved from downloadHubFile()); note that file name is subject to name restrictions identical to regular use of File Manager. (Only ASCII letters, digits, dots, underscores, and hyphens are allowed; a file with any other name is not written.) (Since 2.3.4)