Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to display image attachment as link only on Confiform?

Jim Wu January 3, 2023

hi all,

Currently I use Confiform to upload images.

But when I uploaded over 200 images, the performance become very bad.

Because when you attached an image file, it will display image on page and I could not change it to dispaly as text link only.

I would like to ask if anyone know how to force to display link only on file/attachment field.

I tried to use "attach.asAttachments.transform(downloadPath).asLinks" but the link is very long.

Thanks

 Screenshot 2023-01-03 211244.png

1 answer

1 accepted

2 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
January 3, 2023

Hi

How would you like to have you links to be rendered?

Image (performance?) is bad, link is very long...

Alex

Jim Wu January 3, 2023

hi Alex,

I would like to show links only even I uploaded images.

Currently when I uploaded an image, it will disply <img scr...>

I am trying to find a solution could let image attachment field to display <a href....>

(just like 10.A.2.txt on my screenshot)

 

Because if I have over 200 images on the page. The page will need to send many requests for those big images. It makes heavy loading on server. But actually I don't need to see all of images every time. It will be better for me If there is an option to force display links.

Alex Medved _ConfiForms_
Community Champion
January 3, 2023

Do you allow multiple uploads?

If not then something like this should work (in the field name parameter of the ConfiForms Field macro)

attach.asAttachment.downloadPath.asLink([entry.attach.asAttachment.fileName])
Jim Wu January 3, 2023

Yes, I need to upload multiple images for one row.

I just tried your solution. It's working pefectly for single image.

Alex Medved _ConfiForms_
Community Champion
January 3, 2023

You can try something like this may be...

attach.asAttachments.iterateAndPrint(<a href="[entry.downloadPath]">[entry.fileName]</a><br/>)
Like Jim Wu likes this
Jim Wu January 3, 2023

hi Alex,

Thanks for reply.

I tried but it seems not work.

Screenshot 2023-01-04 102056.png

Jim Wu January 3, 2023

hi Alex, 

Thanks for help. It works after I added ".renderAsHtml".

attach.asAttachments.iterateAndPrint(<a href="[entry.downloadPath]">[entry.fileName]</a><br/>).renderAsHtml

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events