How to get the path to the attachment?

inadequte999 October 26, 2017

How to get the path to the attachment?

def path = ComponentAccessor.getAttachmentPathManager().getAttachmentPath()
log.info("Path " + path);

But there is no attachment in this directory/

1 answer

0 votes
Mizan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 26, 2017

Where are you running this script ? on your production instance or test instance ?

Normally, when backups are restored on test instances , many administrators do not take attachments due to the size of the attachments directory.

inadequte999 October 27, 2017

On my instance.
I tried it like this, it works. Is there a better way?

File attachmentFile = AttachmentUtils.getAttachmentFile(numberAttachments);

Suggest an answer

Log in or Sign up to answer