You need to sign in to do that
Don't have an account?
ozhere
Cannot decode attachment body
Hi,
I am trying to decode attachment body with this code:
foreach($response->records as $attachment){
$attachmentBody = $attachment->Body;
echo base64_decode($attachmentBody);
}
But the result is null. 'Echo $attachmentBody' prints some unreadable text. What is the right way to decode attachment body?
Thank you,
-O
What result is null?
Which is the Content-Type of the attachment body?
All Answers
What result is null?
Which is the Content-Type of the attachment body?
Hi Murray,
Thank you for your reply. I got the problem solved, and the reason was not decoding code.
The problem was if only one attachment is returned and (is_object($attachments->records), the records should be retrieved differently from (is_array($attachments->records)).
Thanks,
-O