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
Sheetal KrishnaSheetal 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?
Sheetal KrishnaSheetal Krishna
Hi,

This is of priority. Can someone help on this?
Sheetal KrishnaSheetal Krishna
I have even tried with the below Query
"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?