Questions tagged [base64]
The base64 tag has no usage guidance.
58
questions
1
vote
1
answer
198
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,...
-1
votes
1
answer
44
views
Parsing a SAML request
I have a Base64 payload I need to decode and edit, and then encode again. The encoded Base64 is an XML file I need to modify, or at least extract values from it. How can I work with the Blob? Can't ...
1
vote
0
answers
36
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 ...
0
votes
0
answers
198
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="...
0
votes
1
answer
301
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
195
views
Salesforce LWC - Access image as base64 from content version
I have an LWC which shows an image and allows me to draw on that image.
The component requires URL or base64 as input, everything works with static images But
I am unable to access the image from ...
0
votes
0
answers
1k
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
518
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 ...
0
votes
0
answers
151
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 ...
0
votes
1
answer
79
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",
"...
0
votes
0
answers
1k
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 ...
1
vote
1
answer
962
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/...
1
vote
1
answer
568
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
914
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
528
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
vote
2
answers
2k
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
427
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
83
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
970
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
537
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 ...
2
votes
1
answer
3k
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"
...
1
vote
1
answer
9k
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 ...
2
votes
1
answer
67
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 ...
1
vote
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
881
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
117
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 ...
1
vote
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
731
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 = ...
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
vote
1
answer
844
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 ...
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 =...
0
votes
1
answer
566
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 ...
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
12k
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
857
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 ...
0
votes
1
answer
153
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 ...
0
votes
1
answer
66
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
13k
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
777
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
13k
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 ...
1
vote
2
answers
820
views
Is Document Body Blob field value encoded in Base64 when extracted by Dataloader? Can this encoding be used for insert or update?
I want to use Salesforce DataLoader to extract and upload Documents.
However, I don't understand in which format Blob Body values are stored, is it Base64 encoded?
Looks like yes, but why it is not ...
2
votes
0
answers
1k
views
Base 64 Content in PDF
We are receiving a base64encoded string from apex webservices and we have to display that as pdf whenever user clicks on a button. currently we have the below code
var isIE = false || !!document....
7
votes
2
answers
2k
views
Integer Array to Base64 String
So I am struggling a bit to convert some code written in java to APEX.
The struggle here is that I have an integer array as one of my encryption key, it looks something similar to this below:
[242, 2,...
8
votes
1
answer
1k
views
How to store (or ignore) Base64 images in emails processed by email-to-case?
We're getting the following error when receiving an email containing a Base64 encoded image directly in the html:
Invalid data specified, the provided data does not seem to be a valid image: [B@...
1
vote
0
answers
219
views
Apex - One extra character in string variable problem
I have recently stumbled upon a rather interesting problem on my end. I have set up an integration with external system, and it responds me with a Base64 encoded Hex code of a PDF document whenever I ...
1
vote
3
answers
3k
views
Unrecognized base64 character: {
I need to have a JSON Formatted Base64 for this, but I am not sure how to change this string to have it as Base64 JSON Format.
public String requestBody = '{["Um05dkxFSmhjZz09"]}';
...
-1
votes
1
answer
138
views
Inserting a PDF Record as attachment Maximum view state size limit (135KB) exceeded [duplicate]
I thought maybe I can do a work around of this issue "Maximum view state size limit (135KB) exceeded" by having the user insert all the document into salesforce first then select the documents that ...