Hi everyone,
I’m having trouble integrating a file upload for MQTT certificates in my custom module. I need to upload a certificate using a file upload editor, but unfortunately, the certificate information (neither its file path nor its content) is being saved to the PersistentRecord.
Here’s what I have so far:
public static final StringField CCACertificate = new StringField(META,"CCACertificate").setDefault("");
CCACertificate.getFormMeta().setEditorSource(FileUploadEditorSource.getSharedInstance());
I expected that when a user uploads a certificate file, this configuration would handle saving the file’s content or path into the CCACertificate field of the PersistentRecord. However, it appears that the record is not storing any data from the file upload.
I’m looking for guidance on the following:
- Proper configuration: How should the file upload editor be configured to ensure that the uploaded file’s information is correctly captured in the record?
- Saving the file content/path: What additional steps or code are necessary to actually persist the certificate’s file path or its content in the record?
- Examples: Are there any similar implementations or examples from which I could draw insights?
Any help or suggestions from anyone who has worked with FileUploadEditorSource in a PersistentRecord or a similar setup would be greatly appreciated.