Get upload file name with upload file in image

Gravity Forms
September 06, 2023 04:44:00
cvla
Topics: 7
Messages: 23
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]
September 06, 2023 08:59:14
E2Pdf
Topics: 7
Messages: 3614
Support
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!
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.