Questions tagged [blob]
108
questions
0
votes
0
answers
15
views
Integration batch job + Data Encryption : Need some suggestion
I have written a batch job to push Open Case record every one hr from Salesforce to External system using REST API. I need to Encrypte the data and push it to the external system. Below is the Class ...
-1
votes
1
answer
43
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
29
views
Unable to save video captured via webcam in Aura Component
I have an Aura component that captures video via webcam and displays it to the user while also giving them the option to save it.
The "playback" feature works as expected using the following ...
1
vote
2
answers
365
views
How to get Binary Data to submit to REST API
I'm attempting to use curl and multipart message to attach files to a created record. I am successfully able to do so, however the file is corrupted when I view it. I think I may not be getting the ...
0
votes
1
answer
435
views
Open a blob file in a new tab of browser in Aura component
I was facing some problems finding a way to open a blob from an Aura (Lightning component) in a new tab of the browser, the window.close() function doesn't work because open with base URL of the ...
1
vote
0
answers
33
views
Popup warning that blob cannot be opened because of browser settings when generating data with Javascript
When generating a CSV file with Javascript, and trying to make the file available for download locally, using the snippet below:
const blobToBase64 = (blob) => {
const reader = new FileReader();...
0
votes
0
answers
204
views
How to convert blob to byte in Apex
There is a requirement that when I am trying to send images/pdfs files from salesforce to external system, the external system is expecting the content in bytes. I have working code of JAVA but not ...
0
votes
1
answer
884
views
How to open a save as dialog from javascript?
I have a pdf file as a blob in javascript. I want to save the it on my local machine. I am creating an anchor tag, and simulating the click event to download the file.
I want to open the "Save as&...
0
votes
1
answer
18
views
How to remove all unicode characters from a blob?
I have a requirement to parse the contents of a csv blob which has unicode characters. When I am trying to parse it using
Blob myBlob = EncodingUtil.base64Decode(response.getBody())
I am getting an ...
1
vote
1
answer
189
views
Use CSS in PDF with Apex
I'm trying to generate a PDF file using Apex only (without using VF).
I'm having trouble using basic css properties like width and height, I tried to include them in the head, tried inline, but ...
1
vote
1
answer
405
views
How we can read Content Version body and update in Long rich text area field of an object?
I have file attached (Word Document) to the custom object record . I want read the file and get the content between some text and store it in the Custom object record field
apex:
ContentVersion con =[...
0
votes
0
answers
33
views
Files are getting corrupted when sent over http request [duplicate]
I am sending files to a third-party system through an HTTP Post request, whenever a new file is uploaded or attached under any of the Order records by writing a trigger for ContentDocumentLink Object. ...
0
votes
0
answers
359
views
Post File to SharePoint from APEX
I am using EinsteinVision_HttpBodyPart approach to create a file in Sharepoint from Salesforce.
EinsteinVision_HttpBodyPart
And consuming it in my below method, with this approach files are creating ...
0
votes
1
answer
978
views
ContentVersion to File Attachment in Email | APEX [closed]
I am trying to get the Blob Version Data from the ContentVersion in Apex class and send it in an Email using the Following Code:
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();...
1
vote
1
answer
343
views
How can I get content version data without making self callout?
I understand that there are several approaches to get content version data.
The default and widely accepted approach is to make self-callout to REST API to get VersionData of VersionData field on ...
1
vote
1
answer
175
views
Make HttpRequest Callout to send binary data without corruption
I faced issues when tried to send binary data from Salesforce to external web services.
To start with, I tried to send binary data from Salesforce to itself.
I am trying to read binary data from valid ...
0
votes
1
answer
430
views
Merging Docx files into one - Apex
I have a requirement, which I should merge two or more word files (.docx) together into one file.
because I can't do arithmetic operations on Blob - I converted it to hex, made the arithmetic, ...
0
votes
1
answer
204
views
Sending PDF file from Salesforce to XERO, but it's not happening
I want to send PDF file which is generated by VF page from Salesforce to XERO.
But I'm trying to send but it's not happening
XERO syntax, it receives like below format
POST /api.xro/2.0/Receipts/...
-3
votes
1
answer
346
views
How to format Excel Column in Apex? [closed]
I'm sending an email via scheduler class with an excel file as an attachment, but the data in the file does not appear to be in proper format. Please check the following image:
The code I'm using to ...
0
votes
0
answers
42
views
UnitTest: Cannot take whole Blob value from return value for System.assertequals
I have a class that I want to do unit_test, which returns Blob value above 3000byte.
Regarding this, I want to compare it with expected value, using toString method.
However, I can't get the whole ...
2
votes
1
answer
397
views
How to upload BLOB using the Quip API
Is it possible to upload an audio file using the Quip API?
I see in the documentation the API supports the upload of blob objects. I can't seem to get this to work properly.
I have tried uploading ...
0
votes
1
answer
92
views
ContentVersion apex decoding [closed]
we are saving a docx and pdf files in contentversion. But having issue in decoding it back.
Blob.tostring doesnt work as the files encoding is not in the UTF-8 formatting.
Can you please help me ...
2
votes
2
answers
341
views
BLOB is not a valid UTF-8 string for the Contentversion of einstein_platform.pem file
In Einstein Playground app developed by the Salesforce Lab, I have uploaded the einstein platform service private key file named einstein_platform.pem to complete my einstein platform service setup. ...
0
votes
2
answers
476
views
Encoding and Decoding BLOB due to error 'BLOB is not a valid UTF-8 string'
I try to encode and decode a BLOB in order to avoid the 'BLOB is not valid UTF-8 string' error, but when I encode the BLOB in UTF-8, decode it again and use the .toString-method, I stil get the error. ...
0
votes
1
answer
982
views
Reading data from csv file stored in salesforce files. Content size of 12mb
I have a requirement to upload the csv file of 12mb and read the content in it. Through Lightningfile upload component i am able to load the file in Salesofrce Files and here is the below link for ...
2
votes
1
answer
751
views
How to read/parse an X9.37 file via Apex?
Background
X9.37 is a standard format used in electronic check exchange (when a depository institution sends an image cash letter file as a deposit to the Federal Reserve Bank, or when the Federal ...
2
votes
3
answers
2k
views
Is there any way to convert a PDF blob value to string in Apex / Javascript lightning controller
I am in need of a way to get a PDF to a readable string format so I can search for specific values in the PDF. But from what i've found so far Apex is unable to get the blob value converted into a ...
1
vote
0
answers
25
views
CSV attachment, replacing \n from cell values
I am trying to create a csv attachment through apex, I am getting the csv with the values. But some values for eg. 'Hi I am xyz.\n This is an example code.'
are getting split to next cell because of ...
1
vote
0
answers
118
views
Download Html + Blob image as text
On my VF page, I need to save to SF an html code with a signature represented as a blob (drawn with HTML5 Canvas) as a text file (preferably MS word).
Right now, I'm not sure if this should be ...
2
votes
1
answer
277
views
Why Blob equals doesn't work if one of the Blobs is retrieved from ContentDocument?
In brief, I can't test the value stored in a ContentDocument. Even if the value of the two Blobs is the exact same, equals would return false. Do someone know the reason?
Here's a unit test to check ...
1
vote
1
answer
2k
views
Convert an apex attachment into a blob?
I am attempting to convert an apex attachment into a blob. My visualforce code is
<div class="mt-5 row">
<div class="d-flex justify-content-center col-lg-12">
<...
0
votes
1
answer
328
views
Apex Error (Image to PDF conversion) : BLOB is not a valid UTF-8 string
So i have this task where i have to convert the image uploaded in Notes and Attachment object to PDF. For that i created a trigger(before insert) on Attachment object and used the below mentioned code,...
0
votes
2
answers
2k
views
Combine two different PDFs in single Visualforce page?
I have used below visualforce code to display two pdf in a single page but in the result, I am getting two different PDFs with two sections with iframe.
Is it possible to combine these two PDFs in ...
1
vote
1
answer
75
views
Can't Convert to String some special Chars
I have a file to insert Accounts ,but some fields like account name have values with special characters like 'ñ' ,and Im having this error "BLOB is not a valid UTF-8 string" when I execute this query:
...
2
votes
0
answers
450
views
Sending 100KB attachment via HTTPRequest throws System.UnexpectedException
I'm trying to upload an attachment from SF to a third party server using REST API,
First, my third party does not support base64 content-transfer so I cannot send from SF a base64 attachment.
...
2
votes
1
answer
19k
views
How to display downloaded PDF blob in an iframe?
I am using a HttpRequest to GET a PDF:
http://www.example.com/path/some.pdf
I am using response.getBodyAsBlob() to store the data into a ContentVersion
I can view the PDF if I open the ...
0
votes
1
answer
563
views
Formatting Excel Column from Apex
I'm sending an email through the batch class with CSV file as an attachment, but the data alignment is wrong after generating CSV, I want the same alignment for all the columns. Please check the ...
3
votes
1
answer
1k
views
Display PDF with Visualforce using Lightning Experience
Is this post still valid as a solution to download a pdf from third-party site, then displaying it in a Visualforce page?
This is what I'm doing in my code:
Visualforce page
<apex:page ...
0
votes
0
answers
503
views
Display blob value in VF page and render as PDF
I am trying to display a PDF stored in static resource and passing the blob as a string to VF page and late rendering as PDF
<apex:page controller="DataDisplayController" renderAs="pdf">
{!...
1
vote
1
answer
1k
views
Get visualforce page pdf blob in apex
I have a visualforce page that renders as a pdf. Is there any way in apex to get that page data as a blob? I've thought about doing an Http GET request, but I feel like there should be a more direct ...
1
vote
0
answers
423
views
Display a PDF in Salesforce from Blob data
For our project, we need to get a PDF via API from an external private filestore, and display it within a Lightning Component. With the blob that is returned, if I set that to the src of an iFrame, it ...
0
votes
0
answers
937
views
Apex Multipart HttpRequest - With JSON and BLOB
I am trying to consume a Google Drive API to create a file in an ApexController.
I was successful in creating a file in the root folder without specifying a name using the code below
http h = new ...
1
vote
1
answer
5k
views
How do I use Blob to create a PDF in my apex controller and use it in my Lightning Component without using VisualForce Pages?
This is the apex controller:
public class pdfGenerate {
public static final Integer limitRecords = 10;
@AuraEnabled
public static Blob generatePdf(){
List&...
5
votes
1
answer
1k
views
How to check Blob objects for equality?
Rather disappointingly for Blobs this assertion fails:
System.assert(Blob.valueOf('abc') == Blob.valueOf('abc'));
though the Apex Expression Operators documentation over ambitiously says that:
...
6
votes
3
answers
4k
views
Unsupported mime Type when creating Blob instance into lightning community
I am having problems when I try to use the lib jsPDF in order to generate dynamic PDF documents and download them from the browser. The problem is 'Unsupported mime type'. This is due to the function ...
3
votes
1
answer
2k
views
Returning a blob to a lightning component split error
I have a lightning component that queries for a Static Resource and returns the body.
When the lightning component receives the blob data aura throws an error
This page has an error. You might ...
7
votes
2
answers
2k
views
MD5 Blob Cannot Convert to String
I'm attempting to generate an MD5 hash in my Apex code and having issues converting the Blob object that Crypto.generateDigest() returns back into a string. The input Blob is a just-Blob.valueOf()-...
3
votes
1
answer
2k
views
What Field Type should be used to assign Blob primitive data type?
I need to assign Blob value to a field. I've already tried Text and URL field types but I've got next error Illegal assignment from Blob to String. Is it possible? What field type should I choose?
...
2
votes
2
answers
2k
views
EROR: BLOB is not a valid UTF-8 string
We have a custom REST api that throws an error when ever we have a diacritic character as part of the JSON request. For example if the character "é" is anywhere in the JSON it errors when we convert ...
0
votes
1
answer
758
views
How to Upload ContentVersion into OneDrive using Apex?
I am unable to send a png file from Salesforce ContentVersion to Microsoft OneDrive. Below is my code:
for (ContentVersion cv : ListFilesToBeUploaded)
{
Http http = new Http();
httpRequest ...