function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ssuede7ssuede7 

Receiving attachments

I wondering if anyone can briefly explain how to handle the body of a file (base64) once you obtain it from a query, i.e. 

 

somethinghere = attachment.getBody(); //how do I receive it?

??? //them how do I make it accessible to someone using my webapp through a link?

 

or a piece of sample code would really be nice.

I'm coding in JSP, I'm running sforce 5, on tomcat.   Thanks in advance!

SuperfellSuperfell
attachment.getBody() returns an array of bytes. (its already been base64 decoded for you by the soap client). set the correct content type header and write that array of bytes to the response output stream.
ssuede7ssuede7
Can you show me a few sample lines of code?  I'm not familiar with how to do that exactly.