Read File Contents From Attached File
Summary
Read File Contents From Attachments in GroovyContent
Hi Team,
We are trying to read the File contents from attachments of Custom object. We are using following the groovy script to read the file contents.
def attachement_coll=Attachment
while(attachement_coll.hasNext())
{
def attchment=attachement_coll.next();
def f_content=attchment.FileContents
}
With above code we are able read file contents from TEXT file,. However, If file type is EXCEL / PDF content is not properly.
Please let us know way forward to read file content from if attachment is EXCEL/PDF.
Regards.
Madhu
Code Snippet
def attachement_coll=Attachment while(attachement_coll.hasNext()) { def attchment=attachement_coll.next(); def f_content=attchment.FileContents }
Tagged:
0