File Upload Handling
  • 19 Dec 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light

File Upload Handling

  • Dark
    Light

Article summary

File Upload Handling

This code example shows how to manage a list of uploaded files were we log the file names and write the each file to disk.

public class HandleFiles extends AbstractRuleExecute {
	
	@Override
	protected boolean preDMProcIn() {
		List<FileItem> fileItems = dialogWorkspace.getFileUploadItems();
		dialogWorkspace.setFileUploadItems(null);
		System.out.println("File Items Count="+fileItems.size());
		for (FileItem item : fileItems) {
			System.out.println("Item: "+item);
			CoreUtil.writeFile(item, fileStorageLocation, fileName);
		}
		return true;
	}
}

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.