Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Including info from form in filename.

Avatar

Level 1

I am trying to programatically change the filename of the PDF to include some information from the form before saving it but I cannot find any methods to do that. Any suggestion anybody?

1 Reply

Avatar

Level 10

Hi,

This can be done, but it is not the easiest. Accessing this information is straightforward but saving the file with that name is considered a security issue. This means that you need a trusted function, which is a folder level javascript file that permits this activity.

For this to work you would need to install the javascript file onto every computer that would access the file. If the javascript file is missing then the script will fail (silently).

There is a long post here with several examples: XFA form with button to save file with unique filename

Good luck,

Niall