Controller
getFiles()
Signature
Section titled “Signature”getFiles() — returns array
Available in: controller
Category: Miscellaneous Functions
Description
Section titled “Description”Primarily used for testing to get information about files sent during the request.
Examples
Section titled “Examples”// 1. Assert that exactly one file was sent during the action (in a test)
processDownload();
files = getFiles();
assert("arrayLen(files) eq 1");
assert("files[1].name eq 'report.pdf'");
// 2. Inspect all files sent during a request
files = getFiles();
for (file in files) {
writeOutput(file.name & " — " & file.type);
}
// 3. Return an empty array when no files were sent
files = getFiles();
// files -> []