Questions tagged [base64]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
40 views

Attachment content is empty

I have a boomi process which takes the file content and send it to salesforce to create attachment. But attachment is blank. Here is my code: String jsonStr = '...
-2 votes
1 answer
50 views

System.assertException while deploying apex trigger handler class & test class to other environment

Email to case is getting created in salesforce from other system and the case subject has the following format : "?utf-8?b?QW5vbWFseSBkZXRIY3Rpb24g4oCTIERFIFNIQVc?=" So am converting into ...
1 vote
1 answer
49 views

Blob is not a valid UTF-8 string error in test class though am converting base64 into normal text in apex class

Am getting case subject "?utf-8?b?QW5vbWFseSBkZXRIY3Rpb24g4oCTIERFIFNIQVc?=" In this format from third party system. So am converting into string as below: String s= case.subject; String s1 ...
  • 11
0 votes
0 answers
143 views

last block incomplete in decryption

I am trying to understand the "Crypto" class provided by Salesforce due to compliance needs with different systems for integration. I am trying to make a combination of these 2 methods ...
2 votes
0 answers
852 views

Convert base-64 string to Blob in your LWC

Requirement : I need to get Blob Data from my File (represented as ContentDocument) in my LWC. Currently I implemented it in next way : I have an Apex method which returns base-64 string for specific ...
1 vote
0 answers
144 views

Attach a base64 string as an attachment into lead object

I have a landing page in marketing cloud which will contain a form with input fields. One of the input field will be for a file attachment. (.pdf or image) I will encode this file to a base64 string. ...
  • 43
0 votes
0 answers
106 views

Convert Base64 decoding from Java to Apex

In Java we have this code: byte[] clientPublicKeyBase = Base64.getUrlDecoder().decode(...); How do I convert this to Apex?
0 votes
2 answers
3k views

Generate and download PDF file from Base64 Encode String

I want to create a LWC to download a simple PDF file with a random string. Here is my code: Apex Class: public with sharing class PdfLwcController { @AuraEnabled public static String ...
2 votes
1 answer
470 views

Parsing JSON in apex - getting error System.StringException: Unrecognized base64 character: {

I am trying to parse a json i get from external system to salesforce using wrapper class. The class works fine but for test class i am trying to hard code a string to test the class. Below is the code,...
  • 7,705
1 vote
0 answers
358 views

HTML Email Template URL Base64 Encode

Based in question HTML Email Template URL Encode That it exposes the problem like: <a href="http://example.com/?region={!URLENCODE(Contact.Region__c)}">Click me</a> I am trying ...
  • 111
0 votes
1 answer
1k views

How to embed a Salesforce File/ContentVersion into a VisualForce rendered PDF?

I've tried some searching and it's unclear to me if what I want to do is possible in Salesforce. I have an image file attached to a Salesforce Case, and I want to use an <apex:page showHeader="...
  • 1,300
0 votes
1 answer
1k views

How to create a test class for apex that reads CSV file

I was trying to test my apex class that gets a CSV file, reads it and creates actual records. In my test class I tried to convert my CSV string into base64 string. Then I used this line of code Blob ...
0 votes
0 answers
2k views

Get Base64 Encoded binary data from file in Apex

I am trying to generate binary data from files in base64 encoded format in Apex. The purpose is to send that resume data to an external system so that they can parse and send it back. I was able to ...
1 vote
1 answer
2k views

EncodingUtil.base64Decode will throw exception on illegal input

We have a web service callout in Salesforce to a third party, that renders illegal content, which means that their web service returns a response that claims to be UTF-8 text, but isn't. When I base64 ...
  • 11
0 votes
0 answers
207 views

REST image upload returning empty json body

Trying my first rest API call with SSJS. I'm trying to upload an image as per this guide https://sfmarketing.cloud/2020/02/29/create-a-cloudpages-form-with-an-image-file-upload-option/ On my landing ...
  • 1
5 votes
2 answers
21k views

How to generate a PDF and have it download from a Lightning Web Component

I'm trying to show a button on a Lightning Web Component, that when clicked generates a PDF and immediately starts downloading it on the browser. The LWC lives in a Screen Flow and I'm currently ...
  • 185
0 votes
1 answer
147 views

base64 as parameter from RestRequest non valid for deserialize

I have a service that allows me to change a user's profile picture. The petition type is POST, and it has the following structure: { "UserId":"0057E000008wDTRQA2", "...
  • 823
1 vote
1 answer
2k views

Convert base64 to pdf and display it in LWC

I have an apex that returns a string, and I want this string to decode it and display it as a pdf to a modal in Lightning Web Component. How can I achieve this? How can I display the pdf without ...
2 votes
1 answer
4k views

What is the difference and pro and cons uploading documents to Rest api Salesforce in binary format or base64

I have been reading several articles about uploading documents trough Rest api to Salesforce but could not find the overal difference between binary format or base64. The main questions I have. Is/...
  • 2,274
1 vote
1 answer
1k views

Hitting heap size limit while trying to convert attachment blob into base64 format

We have a requirement to process attachments to convert blob to base64 format. We are querying the attachment body (i.e. in blob format) and converting that into base64 format in apex class. Below is ...
5 votes
2 answers
1k views

Download ContentVersion Object as JPG using JSForce

I am trying to download a JPG file stored as an attachment in Salesforce, to the local machine. I have a URL that works correctly when using a GET request in Workbench. When I try to do the same in ...
0 votes
1 answer
973 views

How to get base64 from Body__s field on Salesforce Classic Knowledge

I am trying to get the base64 encoded version of a Salesforce Classive File Upload field type via the Salesforce REST API from one org to another. However when I query the rest API for the knowledge ...
  • 1,959
1 vote
2 answers
3k views

How do I get correct base64 data present in VersionData field in ContentVersion through jsforce?

I am using jsforce to query VersionData field in ContentVersion object. However, it returns me the URL to the base64 data instead of the actual data. If I make a GET request to the URL (using the ...
1 vote
1 answer
616 views

Is there a BASE64 Encoding Function using SQL in Automation Studio? [closed]

We'd like to BASE64 Encode our Email Addresses so we can send them to an external third-party (it's the third-party's requirement). We know how to do it using AMPscript, but not in SQL. Ultimately, ...
0 votes
1 answer
123 views

UTF8(stringToSign)

Seems like I am not converting the following code from AWS docmentation correctly in Apex ? Signature = base64(hmac-sha256({accessKeySecret}, UTF8({stringToSign}))) My conversion Blob mac = Crypto....
0 votes
1 answer
1k views

base64 hash using HMAC SHA256

I am trying to compute the Apex equivalent of the following - var shaBodyContent = CryptoJS.HmacSHA256(stringToSign, postman.getEnvironmentVariable("HMAC_SS")); var b64BodyContent = shaBodyContent....
0 votes
0 answers
686 views

Converting base64 to pdf problem

//This is solved. I was converting as pdf but below base64 is in ZIP type. I have changed the code as application/zip and solved! I have a class that takes base64 string and I am converting this ...
2 votes
1 answer
2k views

Displaying Images on Visualforce pages using Base64 Blob

My question is about displaying base64 blob as image in visualforce page. Here's my controller code: Object img; public Object getImg () { List<ContentVersion> bodyList = [SELECT ...
  • 185
2 votes
1 answer
4k views

download base64 as PDF seting a name for it

I'm trying to download a PDF file and I wish to give a name to this file and a extension. Here is what I did: Component: <aura:component implements="forceCommunity:availableForAllPageTypes" ...
2 votes
1 answer
11k views

System.StringException: Unrecognized base64 character: \

I am trying to parse the response body which is in "base64 content of a file" and trying to create the attachment with the body but getting error of " Unrecognized base64 character: \" I have included ...
  • 127
2 votes
1 answer
76 views

How to call a web service with base85 encoded data?

I need to make a call to a 3rd party SOAP web service from Apex that accepts images encoded in base85 rather than the more standard base64. I don't see that this is supported in Salesforce, any ideas ...
  • 305
3 votes
2 answers
2k views

JWT, Cyrpto.Sign and EncodingUtil.base64Encode

I'm writing my own class to create a JWT. Using the JSONGenerator I am creating the header and payload, base64 encoding these with EncodingUtils. I am then creating a blob from these to sign and use ...
1 vote
1 answer
1k views

REST Upload attachments - Json Deserialization failed on token 'null'

I'm using simple-salesforce to migrate attachments from one org to another. I'm encoding with base64 but am getting this error: SalesforceMalformedRequest: Malformed request https://my_org.my....
3 votes
1 answer
2k views

Issue while uploading file greater than 5MB

I am trying to upload a file in salesforce and send it to Sharepoint for storage using synchronous call. However, when i upload file more than 5MB i am encountering an issue like below :' {FAILURE=...
1 vote
0 answers
126 views

How to capture change in iframe source content?

I am able to show my base64 pdf form data with iframe on Vf page in an editable form so that my user can edit in form and after that, I can store in attachment but I can't able to capture the change ...
0 votes
2 answers
2k views

Retrieving VersionData with standard REST API

I am trying to retrieve VersionData with a standard REST API call from a VisualForce Page a then upload it to a S3 bucket but end up with corrupted files. I believe this is an encoding problem on the ...
1 vote
1 answer
870 views

Attachment uploaded using base64 encode is throwing an error

I am trying to upload a pdf file from anonymous block using the following code public static Id saveTheFile(Id parentId, String fileName, String base64Data, String contentType) { base64Data = ...
  • 1,175
2 votes
0 answers
63 views

Rest API downloading Idea AttachmentBody

When downloading Idea's AttachmentBody field per the documentation, the download gets a 400. Example: services/data/v37.0/sobjects/Idea/087c00000009GDVAA2/AttachmentBody services/data/v37.0/...
  • 1,089
1 vote
1 answer
1k views

Insert base64 string as attachment using apex dataloader

I have a .csv file which has a column containing base64 string equivalent of a image. Anyway we can load the csv file into Attachments object or ContentVersion object using apex dataloader? I know if ...
  • 351
0 votes
3 answers
2k views

CSV decode in Apex

I am trying to read the CSV values in apex. I am getting the base64 file in apex, however not able to read the data. Helper method: uploadHelper: function(component, event) { var fileInput =...
  • 1,509
0 votes
1 answer
639 views

Metadata API file based retrieve and deploy calls

I want to build an java application where my code take package.xml and retrieve all metadata. Well this one is done using Java Example code given by Salesforce. Now I need to unzip that zip and do ...
  • 1
4 votes
0 answers
1k views

Charset for Platform Event not UTF-8?

When trying to publish a platform event from our middleware solution (Boomi) to our salesforce instance, I'm receiving a 400/Bad request (this was intermittent, as some would process without issue). ...
5 votes
1 answer
15k views

base64encode/decode issues with Blob.toString() method

Why would this work in anonymous apex: String a = '[{\"salesOrder\":{\"externalId\":\"\",\"ebsHeaderId\":\"12345\",\"ebsOrderNumber\":\"12345\",\"orderNumber\":\"12345\",'; String encode = ...
1 vote
0 answers
998 views

REST API: Insert or Update Blob Data

Looking to the community for some help on this one.. I've been using postman to deliver a multipart message with the binary data to upload a document to a document folder through the REST API. The ...
  • 206
0 votes
1 answer
171 views

How to create a Chatter File from a big base64 string to image png

I have a problem with chatter files, I have a webcam theese webcam take a snap and I need upload this snap to chatter entry in a Chatter of custom object. After of take a picture with the webcam I ...
  • 17
0 votes
1 answer
71 views

HttpRequest Converting > to?

I am using code (see below) that I found for sending an AWS SES message with an HttpRequest to amazon. I am able to send MIME messages with PDF attachments and all has been great. Today, I tried ...
0 votes
2 answers
15k views

Save base64 data as Attachment

This has been bugging me for a while. I think I am missing something very obvious. So from a REST api I am getting a base64 data of a PDF. I am trying to save the PDF as Attachment under an object. I ...
1 vote
1 answer
872 views

Retrieving a standard base64 field from Lightning Component causes internal server error

In a component, I'm returning a list of ContentNote from the server and displaying the records' data in an aura:iteration. Including ContentNote.Content (a base64-type field) in the return from the ...
1 vote
1 answer
2k views

Displaying user's profile picture dynamically in email template

I have a requirement to display user's profile picture dynamically in the email template. Email template: <messaging:emailTemplate subject="Test" recipientType="Contact" relatedToType="Account"&...
6 votes
7 answers
14k views

uploading files in contentVersion using lightning component

I am developing a lightning component to upload files in the contentVersion object. I used this site as a reference: http://peterknolle.com/file-upload-lightning-component/ I was able to ...