Questions tagged [base64]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
51 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
103 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
63 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. ...
  • 41
0 votes
0 answers
60 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
0 answers
32 views

Uploading an image via REST API [duplicate]

According to this blog, I'm trying to upload a file to salesforce, and link to the file from a case. This is part of ny code: const base64Content = fs.readFileSync('/home/***/Desktop/version.png', { ...
2 votes
1 answer
320 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,635
1 vote
0 answers
234 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
725 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,218
0 votes
1 answer
834 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
1k 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
171 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
0 votes
1 answer
103 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", "...
  • 791
0 votes
0 answers
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
2k 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,206
1 vote
1 answer
772 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
759 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,899
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
509 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
93 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
602 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 ...
  • 175
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" ...
1 vote
1 answer
10k 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 ...
  • 117
2 votes
1 answer
69 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
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
966 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
123 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
807 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,123
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
959 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 ...
  • 341
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,441
0 votes
1 answer
598 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
13k 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
928 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 ...
  • 196
0 votes
1 answer
165 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
68 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
14k 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
814 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 ...
1 vote
2 answers
879 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 ...
  • 14k
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....
  • 21
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,...
  • 299
8 votes
1 answer
2k 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,084