File Upload via iiq forms

Version: 8.5p1

We have a requirement, i.e need to provide an option to upload attachment (CSV/PDF) in the form, can we do that in the forms??.

And this attachment should be download and attach in the email notification, this all should be processed via custom workflow.

is there any way to achieve this??

I think OOTB forms do not support file upload, IIQ Plugins could be used to achieve this

Hello Anjaneyulu. IIQ forms do not have a built-in file upload field type. There is no native way to add one to a standard form definition. (docs)

If the process can work as a manual single-user access request, IIQ has a built-in attachment feature you can enable under Global Settings > IdentityIQ Configuration > Miscellaneous > Attachment Settings. You can configure permitted file extensions, max file size, attachment count, and AttachmentConfig rules. This only applies to single-user access requests though, not custom workflow forms.

If the upload must stay inside a custom workflow form, you would need a custom XHTML renderer with a backing managed bean (or a plugin). This community example covers the full setup and could be a useful reference. It was not validated against 8.5p1 specifically, so it would need testing in your environment.

For attaching the file to the email notification, once you have the validated file content as byte[], you can use EmailFileAttachment:

import sailpoint.object.EmailTemplate;
import sailpoint.object.EmailOptions;
import sailpoint.object.EmailFileAttachment;
import sailpoint.object.EmailFileAttachment.MimeType;

EmailTemplate template =
    context.getObjectByName(EmailTemplate.class, "Your Template");

String normalizedName = fileName.toLowerCase(java.util.Locale.ROOT);
MimeType mimeType;

if (normalizedName.endsWith(".pdf")) {
    mimeType = MimeType.MIME_PDF;
} else if (normalizedName.endsWith(".csv")) {
    mimeType = MimeType.MIME_CSV;
} else {
    throw new GeneralException("Unsupported file type");
}

EmailOptions options = new EmailOptions();
options.setTo(recipientEmail);

EmailFileAttachment attachment =
    new EmailFileAttachment(fileName, mimeType, fileData);

options.addAttachment(attachment);
context.sendEmailNotification(template, options);

Make sure to validate file size, extension, and actual content type before storing or emailing, as IIQ does not verify that file contents match the extension.

@Anjan_dummeda I think you can achieve this via plugins or using custom xhtml page. I am remembering discussing the similar thing few months back with one of the Sailor in the community. Let me find that and share.

@Anjan_dummeda Please see this post: Custom File Upload Quicklink - IdentityIQ (IIQ) / IIQ Discussion and Questions - SailPoint Developer Community

We shared working artefacts. Here after getting the file in form, we are placing it in a server, but you need to write a piece of code to send an email with attachment.

Please check and if you still has queries , we can connect and discuss.

Hi @harish, thanks for the response…