Files¶
Represents a file repository: stored files that are identified by their IDs.
Remarks¶
The repository of standalone files is $Files. The main tasks are:
- Add files from text, Base64 content or HTML, and read their content.
- Copy, rename, replace, delete, hash, compress and extract the text of files.
- Transfer files to and from a remote server over FTP, FTPS, SFTP or HTTP with FileTransferOptions.
Methods that add files return a FileInfo; store its ID in the process data to show the file on a form.
Capabilities¶
Content Operations¶
- Files.AddBase64: Adds a new file to the repository with Base64 encoded content and returns the created FileInfo.
- Files.AddPDF: Adds a new PDF file to the repository with HTML content and returns the created FileInfo.
- Files.AddString: Adds a new text file to the repository and returns the created FileInfo.
- Files.ExtractText: Extracts the text content of a file.
- Files.FromBase64: Converts the given Base64 encoded string to a string.
- Files.Get: Returns the file information by its ID.
- Files.GetBase64: Returns the content of the file as Base64 encoded.
- Files.GetString: Returns the file content as a string.
- Files.SetBase64: Updates the content of the file with the given ID.
- Files.ToBase64: Converts the given string to a Base64 encoded string.
File Operations¶
- Files.Copy: Creates a new copy of the file.
- Files.Delete: Deletes the specified file from the repository.
- Files.Download: Downloads a file from a remote environment, stores it in the repository, and returns the created FileInfo.
- Files.Rename: Renames or moves a file on a remote environment.
- Files.Replace: Replaces the contents of a file with the contents of another file.
- Files.Upload: Uploads the specified file to a remote environment.
Directory Operations¶
- Files.GetDir: Lists the contents of a directory from a remote environment.
- Files.GetDir2: Lists a directory from a remote environment with additional information.
- Files.MakeDir: Creates a new directory on a remote environment.
- Files.Remove: Removes a file from a remote environment.
- Files.RemoveDir: Removes a directory from a remote environment.
Metadata¶
- Files.Hash: Returns the hash of the specified file.
Archive Operations¶
- Files.UnZip: Extracts the files inside an archive file into the database and returns an array containing file information.
- Files.Zip: Creates a Zip archive of the specified files.