Given a path, locate the Attachment ....?

Discussions related to custom development with Select.
Post Reply
Posts: 51
Joined: Wed Jul 25, 2012 9:39 am

Given a path, locate the Attachment ....?

Post by toddsou » Tue Jun 09, 2020 2:45 pm


SPS version 4.3

My starting point is a path string, which identifies an Attachment in my currently active Order.

Is there a way to resolve that path to the desired IAttachmentFile ?

Here's a snippet from an example in the SDK :

Code: Select all

IAttachmentFile fileItem =
    .Where(t => t.Path == filePath)
....but I'm assuming it only queries files within the given folderitem, but I want to use the SDK to locate the target anywhere in the Attachments tree.

Please advise.

Thank you.

Posts: 1000
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC

Re: Given a path, locate the Attachment ....?

Post by BobRichards » Tue Jun 09, 2020 4:00 pm

Unfortunately, there is no direct way to descend the attachment folders. You can use String.Split to break the path into parts and move down one IAttachmentFolder at a time until you reach the desired file.
Bob Richards, Software Developer, SoftPro

Post Reply