Get upload file name with upload file in image

Gravity Forms
6 September, 2023 04:44:00
cvla
Topics: 6
Messages: 22
Hi,

1. Is it possible to get the upload image name with multiple upload field in pdf
2. Is it possible to get the upload image caption in pdf which is upload from gravity form

We are using the following code to display images in dynamically in pdf
[e2pdf-format-output explode="," explode_filter="array_filter" filter="trim" output="{0}"]{Upload:1},{Upload:2},{Upload:3},{Upload:4}[/e2pdf-format-output]
6 September, 2023 08:59:14
E2Pdf
Support
Topics: 7
Messages: 3188
Hello,

Unfortunately, there is no default function to get the file name. You can try to accomplish the task by adding a custom PHP filter to your themes functions.php or as a PHP snippet: https://codefile.io/f/Uip5ymJdJe

After the snippet is added, it must be possible to use the shortcode to output the filename:

[e2pdf-format-output explode="," explode_filter="array_filter" filter="trim" output="{0}" get_file_name="true"]{Upload:1},{Upload:2},{Upload:3},{Upload:4}[/e2pdf-format-output]

If under "image" caption you mean the data added to the file in WordPress directly - you can try to modify the code to get the attachment ID by the URL and output the caption from the attachment but unfortunately, we can't provide you with that code example directly.
We would really appreciate your feedback at WordPress.org!