Questions tagged [base64]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
48 views

Failed to create a Valid JWT token

I am currently working on sending a request to Snowflake using Key Pair Authentication. They have provided me with a private key and a public key, and for testing purposes, I have hardcoded them as ...
Salvation's user avatar
  • 1,137
0 votes
1 answer
37 views

Is allowing "data:" in CSP Trusted Sites a security concern?

We have a requirement to display a pdf embedded in a LWC. The pdf is base64 encoded and we would prefer not to store it as File. It is many places suggested to add "data:" as a an allowed ...
m_sfdc's user avatar
  • 3
0 votes
1 answer
39 views

How to change file properties(Created By, Modified By etc.) while sending file as base64 in API Callout? [closed]

I have requirement of Creating a file (in base64 form) using POST callout in Microsoft OneDrive API. But I want to change the file properties like Created by Name, Last Modified Name, Owner Name etc. ...
Parvez Alam's user avatar
0 votes
1 answer
96 views

Overcoming Salesforce API Heap Size Limitations in Document Retrieval - Need Advice

I am currently working on an integration project involving the Salesforce API. My project uses an Apex class to call a Quarkus service that interacts with a Document Management System (DMS) on Azure. ...
Kévin's user avatar
  • 1
0 votes
1 answer
114 views

Weird "common.apex.runtime.impl.ExecutionException: Syntax error"|0x78b85a0a while doing a Callout

I am basically sending a PDF as a binary file but the request is not going anywhere. The stack trace is following: 23:24:18.100 (138575175)|USER_DEBUG|[28]|DEBUG|50977 23:24:18.100 (138583678)|...
ymiki's user avatar
  • 63
0 votes
2 answers
87 views

generate image from base64 string

We are trying to generate barcodes on the pdf without using any external site. I have the generated base64 string which i am calling on my vf page to generate the image of barcode. My barcode is not ...
SalesforceKid's user avatar
0 votes
1 answer
195 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 = '...
sThirumagal93's user avatar
-2 votes
1 answer
53 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 ...
Sweetie's user avatar
1 vote
1 answer
107 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 ...
Sweetie's user avatar
  • 11
1 vote
0 answers
2k 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 ...
Vitalii Dehnerys's user avatar
1 vote
0 answers
201 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. ...
Rahul's user avatar
  • 43
0 votes
0 answers
139 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?
Holmes285's user avatar
1 vote
2 answers
5k 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 ...
Tran Tai's user avatar
2 votes
1 answer
872 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,...
RedDevil's user avatar
  • 7,765
1 vote
0 answers
521 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 ...
shakaran's user avatar
  • 111
0 votes
1 answer
2k 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="...
Andy Ray's user avatar
  • 1,409
0 votes
1 answer
2k 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 ...
Xrhstos Kolonis's user avatar
0 votes
0 answers
3k 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 ...
Salesforce Development's user avatar
1 vote
1 answer
3k 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 ...
EdP's user avatar
  • 11
0 votes
0 answers
244 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 ...
Emil's user avatar
  • 1
5 votes
2 answers
28k 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 ...
Dan's user avatar
  • 185
0 votes
1 answer
254 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", "...
molinet's user avatar
  • 867
1 vote
1 answer
4k 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 ...
Kostas Karagiannis's user avatar
3 votes
1 answer
7k 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/...
Thomas's user avatar
  • 2,294
1 vote
1 answer
2k 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 ...
SFDCUser's user avatar
5 votes
2 answers
2k 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 ...
Scott Harrison's user avatar
0 votes
1 answer
1k 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 ...
S.B.'s user avatar
  • 2,039
1 vote
2 answers
4k 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 ...
Sumit Israni's user avatar
1 vote
1 answer
746 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, ...
George Rosedale's user avatar
0 votes
1 answer
244 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....
GroundToCloud's user avatar
0 votes
1 answer
2k 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....
GroundToCloud's user avatar
0 votes
0 answers
849 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 ...
Halil İbrahim Özdemir's user avatar
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 ...
Illusion's user avatar
  • 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" ...
M. Massula's user avatar
3 votes
1 answer
14k 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 ...
Avesh's user avatar
  • 137
2 votes
1 answer
109 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 ...
scottrm's user avatar
  • 305
4 votes
2 answers
3k 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 ...
user3615609's user avatar
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....
shartshooter's user avatar
3 votes
1 answer
3k 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=...
user47646's user avatar
1 vote
0 answers
136 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 ...
Kapil Sharma's user avatar
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 ...
Petr Vav's user avatar
1 vote
1 answer
977 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 = ...
Madhurima's user avatar
  • 1,265
2 votes
0 answers
66 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/...
dmachop's user avatar
  • 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 ...
sfdcdev's user avatar
  • 361
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 =...
Ajay 's user avatar
  • 1,529
0 votes
1 answer
677 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 ...
Jeet's user avatar
  • 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). ...
Nathan Lee's user avatar
5 votes
1 answer
17k 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 = ...
Nathan Lee's user avatar
1 vote
0 answers
1k 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 ...
Tony H.'s user avatar
  • 206
0 votes
1 answer
177 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 ...
netovs's user avatar
  • 17