Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

File attachment in bytearray

Luca Armienti1
Tera Expert

Hi,

 

Is there a way to convert a file attachment in a bytearray stream? not base64, an Array of bytes.

 

It's needed for an integration: the web service is asking for a file in byte array format.

 

I tried two things:

 

1) Packages.java.io.ByteArrayOutputStream();
2) GlideSysAttachment.getContentStream(), and then using GlideTextReader as suggested, but i don't understand what GlideTextReader methods do, it's not well explained.
 
The first option give me a small string like "[B@143e765" instead of a byte stream. The second one i can't even make it work.
 
Thanks,
Luca
 
0 REPLIES 0