<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [resolved] salesforce: upload file into attachement object fails in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249805#M34231</link>
    <description>Hi,&lt;BR /&gt;I have aleready tested that with the same results.&lt;BR /&gt;The talend component should recognise that the "BODY" column of the attachment object isn't a simple value column but a reference to a file.&lt;BR /&gt;When i see the code generated i read that the tsalesforceoutput doesn't diffrencies that type of column from the others.&lt;BR /&gt;Thank you for any help.&lt;BR /&gt;Regards,&lt;BR /&gt;Erwan</description>
    <pubDate>Tue, 31 May 2011 08:45:33 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2011-05-31T08:45:33Z</dc:date>
    <item>
      <title>[resolved] salesforce: upload file into attachement object fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249803#M34229</link>
      <description>Hi, &lt;BR /&gt;I have a problem uploading files in Salesforce into "Attachment" Object using tSalesforceOutput.&lt;BR /&gt;My file is well formatted because when I use another Loding tool it works (Dataloader).&lt;BR /&gt;My input file reference files stored in a windows network repository : "\\server\rep\file.doc" but when i run the job, it insert the row and consider that the file referenced in the standard salesforce column "BODY" is the title of the file instead of the real file.&lt;BR /&gt;Do you know if this is a bug or if there is a way to make talend recognise that the string value at the "BODY" column is the title of the file and not what is inside the file.&lt;BR /&gt;Thank you in advance,&lt;BR /&gt;Erwan</description>
      <pubDate>Sat, 16 Nov 2024 12:53:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249803#M34229</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T12:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] salesforce: upload file into attachement object fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249804#M34230</link>
      <description>Hi Erwan 
&lt;BR /&gt;Maybe the problem is caused by the windows network repository : "\\server\rep\file.doc", it is failed to open the remote file? Try to put the file on local machine and test again. 
&lt;BR /&gt;Waiting for your feedback! 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 31 May 2011 02:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249804#M34230</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-31T02:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] salesforce: upload file into attachement object fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249805#M34231</link>
      <description>Hi,&lt;BR /&gt;I have aleready tested that with the same results.&lt;BR /&gt;The talend component should recognise that the "BODY" column of the attachment object isn't a simple value column but a reference to a file.&lt;BR /&gt;When i see the code generated i read that the tsalesforceoutput doesn't diffrencies that type of column from the others.&lt;BR /&gt;Thank you for any help.&lt;BR /&gt;Regards,&lt;BR /&gt;Erwan</description>
      <pubDate>Tue, 31 May 2011 08:45:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249805#M34231</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-05-31T08:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] salesforce: upload file into attachement object fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249806#M34232</link>
      <description>OK, i fixed the problem by opening the file , converting inputstream into a byte table and use "commons-codec.jar" to convert file into base64. 
&lt;BR /&gt;I did that because i knew that salesforce old the file in base64 format so i supposed the talend object didn't make this final work for that specific standard "attachment" object. 
&lt;BR /&gt;Here is the code working fine. My files are all uploaded to salesforce (be carefull to have file smaller than 5 Mo): 
&lt;BR /&gt; 
&lt;BR /&gt;File file = new File(input_row.BODY); 
&lt;BR /&gt;//File file = new File(input_row.DESCRIPTION); 
&lt;BR /&gt;InputStream is = new FileInputStream(file); 
&lt;BR /&gt; // Get the size of the file 
&lt;BR /&gt; long length = file.length(); 
&lt;BR /&gt; // You cannot create an array using a long type. 
&lt;BR /&gt; // It needs to be an int type. 
&lt;BR /&gt; // Before converting to an int type, check 
&lt;BR /&gt; // to ensure that file is not larger than Integer.MAX_VALUE. 
&lt;BR /&gt; if (length &amp;gt; Integer.MAX_VALUE) { 
&lt;BR /&gt; // File is too large 
&lt;BR /&gt; } 
&lt;BR /&gt; // Create the byte array to hold the data 
&lt;BR /&gt; byte[] bytes = new byte; 
&lt;BR /&gt; // Read in the bytes 
&lt;BR /&gt; int offset = 0; 
&lt;BR /&gt; int numRead = 0; 
&lt;BR /&gt; while (offset &amp;lt; bytes.length 
&lt;BR /&gt; &amp;amp;&amp;amp; (numRead=is.read(bytes, offset, bytes.length-offset)) &amp;gt;= 0) { 
&lt;BR /&gt; offset += numRead; 
&lt;BR /&gt; } 
&lt;BR /&gt; // Ensure all the bytes have been read in 
&lt;BR /&gt; if (offset &amp;lt; bytes.length) { 
&lt;BR /&gt; throw new IOException("Could not completely read file "+file); 
&lt;BR /&gt; } 
&lt;BR /&gt; // Close the input stream and return bytes 
&lt;BR /&gt; is.close(); 
&lt;BR /&gt; 
&lt;BR /&gt; Base64 tmp = new Base64(); 
&lt;BR /&gt;output_row.BODY = new String(tmp.encode(bytes)); 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Erwan</description>
      <pubDate>Tue, 31 May 2011 13:35:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249806#M34232</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-05-31T13:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] salesforce: upload file into attachement object fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249807#M34233</link>
      <description>Hi Erwan 
&lt;BR /&gt;Glad to see you resolve the problem by yourself and share the solutions, it will be nice if you can also report it on our bugtracker, our developer will fix it on next release. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 31 May 2011 14:52:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249807#M34233</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-31T14:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] salesforce: upload file into attachement object fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249808#M34234</link>
      <description>Hi All,
&lt;BR /&gt;Does anyone know if this got fixed?
&lt;BR /&gt;Thanks
&lt;BR /&gt;Martin</description>
      <pubDate>Fri, 15 Jun 2012 09:57:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249808#M34234</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-15T09:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] salesforce: upload file into attachement object fails</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249809#M34235</link>
      <description>II've just fallen into this issue. I originally used the file path for the body but have since noticed that is just how Dataloader have implemented the code. Talend seems to sent the file as is and let salesforce process it, so I have tried using the base64 encoded file contents but I'm still getting batch invalid. I am inserting the name, body, parentid but just can't get this to work.
&lt;BR /&gt;I am using a slightly older version (will check when I get back to the office), so perhaps this has been resolved in newer versions...</description>
      <pubDate>Wed, 02 Sep 2015 13:36:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-salesforce-upload-file-into-attachement-object-fails/m-p/2249809#M34235</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-02T13:36:59Z</dc:date>
    </item>
  </channel>
</rss>

