Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
825 views
in Technique[技术] by (71.8m points)

AEM Forms (PDF Type) File Attachments

I am trying to implement file attachment to my AEM Form. The idea is to embed the attachment to the PDF; Upon submission of the PDF, the backend system will be able to extract the attached file from the PDF.

I can't seem to find any example on how I can go about doing it, which make me wonder is it a limitation. However, on adobe site below, it is actually stated "Support for file attachments" for all AEM form types.

https://helpx.adobe.com/aem-forms/6/introduction-aem-forms.html

Please advice! Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can upload, preview, and submit attachments with HTML5 forms. By default, the attachment support is disabled. To enable the attachment support:

1- Create a custom profile with mutiselect string property mfAttachmentOptions.

2- In the custom profile, specify properties fileSizeLimit, multiSelect, and buttonText to configure options of the file attachment widget. As required, you can also specify more custom properties.

3- In the custom profile, use the following configurations:

  • multiSelect -> true or false (true by default)
  • fileSizeLimit -> value_in_mb (say 5) (2 MBs by default)
  • buttonText -> Button text for pop-up window ("Attach" by default)
  • accept -> file types to accept ("audio/, video/, image/, text/, .pdf" by default)

4- Use the metadata editor to select the custom profile that you have created above for HTML 5 forms.

5- Render your form template with custom profile and the attachments icon would appear on the forms toolbar.

6- Click the attachment icon, an attachment selection dialog box appears. Browse and select the attachment and click Attach.

When attachments are enabled, HTML5 form submits multipart data. The mutli-part submission data has two parts dataXml and attachments.

Reference: https://helpx.adobe.com/aem-forms/6-1/html5-forms/enabling-attachments-html5-form.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...