You need to sign in to do that
Don't have an account?
Sheetal Krishna
Download Attachments
HI All,
I am trying to download a Case Attachment and below is the query I use.
Query = getFetchDraftUrl() + "?q=" + URLEncoder.encode("SELECT Name,Body FROM Attachment WHERE Id = '"+ fileId + "'", "UTF-8");
But the response I get for Body is in URL
" "attributes":{"type":"Attachment","url":"/services/data/v34.0/sobjects/Attachment/00P4D000000wkcZUAQ"},"Id":"00P4D000000wkcZUAQ","Name":"test 8.txt"} "
I am expecting the Base64 data. Is there anything wrong that I am doing? Can someone help me understand this?
I am trying to download a Case Attachment and below is the query I use.
Query = getFetchDraftUrl() + "?q=" + URLEncoder.encode("SELECT Name,Body FROM Attachment WHERE Id = '"+ fileId + "'", "UTF-8");
But the response I get for Body is in URL
" "attributes":{"type":"Attachment","url":"/services/data/v34.0/sobjects/Attachment/00P4D000000wkcZUAQ"},"Id":"00P4D000000wkcZUAQ","Name":"test 8.txt"} "
I am expecting the Base64 data. Is there anything wrong that I am doing? Can someone help me understand this?
This is of priority. Can someone help on this?
"https://<salesforceInstance>my.salesforce.com/services/data/v34.0/sobjects/Attachment/00P4D000000wmuCUAQ/Body "
This is returning me the actual file contents and not the Base64 data though I am storing the Base64 data while saving the attachments.
I am not sure whats wrong here, if someone can help identify?
http://lovesalesforceyes.blogspot.com/2020/06/apex-trigger-to-store-file-type.html