Skip to main content
5 votes
Accepted

What is the difference between Blob.valueOf and EncodeUtil.base64Decode?

tl;dr: Blob.valueOf doesn't encode or decode the string, but uses it as is, while EncodingUtil.base64Encode and EncodingUtil.base64Decode convert to/from a 7-bit safe encoding format for use in ...
sfdcfox's user avatar
  • 500k
3 votes
Accepted

How can I insert an image blob obtained from the ClipboardAPI as a file attached to a record, via an LWC?

To fix your issue with attaching images in Salesforce using LWC, you'll need to tweak how the image data is handled. Start by converting the image (which you got from the ClipboardAPI) into a base64 ...
aryashah2k's user avatar
2 votes
Accepted

Blob.valueOf() creates corrupted .zip for application/octet-stream HttpResponse

I found a solution, not deleting question, because it may be helpful for others: Use res.getBodyAsBlob() instead of Blob.valueOf(res.getBody()).
Mariia Illarionova's user avatar
2 votes
Accepted

Create Excel file in Batch Apex Class

Technically yes, but practically no. Excel files are relatively complex beasts following the Office Open XML SpreadsheetML format that are put into a Zip archive. Salesforce doesn't provide any class/...
Derek F's user avatar
  • 63.2k

Only top scored, non community-wiki answers of a minimum length are eligible