Questions tagged [blob]

The tag has no usage guidance, but it has a tag wiki.

Filter by
Sorted by
Tagged with
1
vote
0answers
13 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
0answers
28 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
1answer
27 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
1answer
16 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 ...
0
votes
1answer
3k views

Merging pdf attachments

I am trying to merge pdf attachments and sending it as email. I am able to merge them but the last pdf always get overwrite all the others and send email as one. When I checked my email attachment ...
0
votes
0answers
151 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 ...
1
vote
1answer
69 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 ...
0
votes
1answer
48 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
2answers
831 views

Continuation pattern and JavaScript Remoting - corrupted file in the response

My current solution is working with following logic: system is calling remote action from vf page in the method there is a HttpRequest, system is calling external system, is sending file which will ...
0
votes
0answers
30 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. ...
3
votes
4answers
15k views

Send Blob file via Apex Rest Callout

I'm trying to send a Blob Apex REST callout and it is keep failing. I tried all the examples in the web but didn't work. What is the standard and correct way to send Blob data via REST callouts? //...
0
votes
1answer
408 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();...
0
votes
2answers
305 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
1answer
721 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 ...
2
votes
1answer
280 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 ...
3
votes
2answers
3k views

File Attachment not working when attaching crm Content

I have a page where the user selects content (that is 5MB or lower, only 2 attachments allowed per email) to use as an attachment in an email. It all seems to work fine, the email sends and there are ...
16
votes
3answers
23k views

Post multipart without Base64 Encoding the body

I am trying to POST a PDF attachment to a Restful web service (not under my control). My issue is that I need to get put the raw bytes of the PDF into the Body of the request and whenever I call Blob....
0
votes
1answer
162 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
1answer
61 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
0answers
157 views

Save the video to files

I'm making a component that allows me to make a video with the capture of the desktop camera. In javascript I have '' vidSave.src '' which is the url of the video that was recorded. When I try to ...
0
votes
1answer
284 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
0answers
821 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 ...
0
votes
1answer
70 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/...
1
vote
3answers
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 ...
-3
votes
1answer
206 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
0answers
36 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
0answers
414 views

Embedding an image in PDF attachment using html tags and Blob.toPdf()

I want to add an image to a pdf I am creating and attach it to an email that I send via apex code. I am using html and Blob.toPdf() to make the pdf. I saw this post regarding Blob.toPdf()'s ...
1
vote
1answer
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
1answer
48 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 ...
1
vote
2answers
208 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. ...
2
votes
0answers
419 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. ...
0
votes
1answer
263 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
1answer
59 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
1answer
696 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
1answer
487 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 ...
6
votes
3answers
3k 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 ...
1
vote
0answers
23 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
0answers
103 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
1answer
194 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 ...
0
votes
2answers
1k 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
1answer
38 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: ...
1
vote
1answer
16k 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
1answer
432 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
1answer
752 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 ...
9
votes
2answers
8k views

How to combine multiple Blob in apex to get single Blob value

Is there a way in Apex to combine multiple Blob values and get a single Blob value? Blob b1 = Blob.valueOf('s1'); Blob b2 = Blob.valueOf('s2'); Blob b3 = Blob.valueOf('s3'); Blob combined = b1 + b2 + ...
0
votes
0answers
383 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"> {!...
7
votes
2answers
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()-...
1
vote
1answer
793 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
0answers
362 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 ...
1
vote
1answer
4k 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&...