Extracting data from an Portal Attachments provider

I’ve been using the portal attachment provider to include files in the business process. Now I’m required to attach those file with an email, but I’m clueless about how to do it. Any suggestion?. Thanks

I found myself the solution with a simple action in the portlet view.

    public String uploadFile() {
        com.webmethods.caf.faces.data.attachments.PortalContainerAttachmentsProvider provider = getPortalContainerAttachmentsProvider();
        if(provider != null)
        {
            List<com.webmethods.caf.faces.data.attachments.IAttachmentItem> listAttachments = provider.listAttachments();
            if(listAttachments != null)
            {
                if(listAttachments.size() > 0)
                {
                    com.webmethods.caf.faces.data.attachments.IAttachmentItem item = listAttachments.get(0);
                    if(item != null)
                    {
                        try
                        {
.
.
.
.

                        }catch(Exception ex) {}
                        
                        
                    }
                }
            }
        }
        return OUTCOME_OK;
    }