Hi, I`m currently doing this. This is how the flow looks like, if you have any question please do let me know.
In my case i have attachments from a legacy system that have been linked to customers. It`s a 2 step flow and it`s using context - 1st step is inserting files into SFDC (using ContentVersion object), 2nd step is quering the imported versions and adding them to a library that is being manually created in advance and sharing to all users through a Public group (Using ContentDocumentObject).
In the first part I`m reading the files from a folder, then i have two csv files where i`m doing two lookups - one for the filename and one for the customer.
I am trying ton insert PDF File in salesForce (ContentVersion), and i know that i must convert the File in 64 base's, is it possible to show the java code in your tjavarow component.
Here some sapmle may be proper to u:
FileInputStream pdfDocument = new FileInputStream(file); byte documentData = new byte[(int)file.length()]; //fill array with some bytes pdfDocument.read(documentData); // Convert bytes array to Base64 string to fill Body field output_row.Body = new String(Base64.encodeBase64(documentData));
You should import the org.apache.commons.codec.binary.Base64 first which is lay in commons-codec-1.11.jar
Watch the recorded webinar!
Create systems and workflow to manage clean data ingestion and data transformation.
Introduction to Talend Open Studio for Data Integration.
Test drive Talend's enterprise products.