I have some Javascript where I extract the Body of a static resource file:
function test() {
var query = sforce.connection.query("Select Body from StaticResource where Name = 'StaticResourceFile'");
var records = query.getArray("records");
var body = records[0].Body;
I have access to the body now, but it appears to be encrypted. How do I decrypt it?
Via Apex, you can do it like this, but with Javascript not so:
Blob blob = [Select Body from StaticResource where Name = 'StaticResourceFile'].Body;
string body = blob.toString(); // actual file contents!