function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sanjeevkchsanjeevkch 

How to run Java code to chunk files in the Apex code / Force.com platform

 

Hi All,

 

   I wrote a Java program to chunk and join files to overcome the 3MB limit of file transfer in Salesforce.

 

   Now the problem is .. how to run in the Sandbox env.

 

    Basically, I want to attach a file to contacts..but if the file is more than 3MB, I want to chunk it and attach 2 files...and while I download the file ....I will join it using the Java program on the server side.

 

   Please, post the code snippets if you have.

Thanks

Sanjeev

bob_buzzardbob_buzzard

You can't run java code on the Salesforce servers - you can only run Apex.

rodrigoBFrodrigoBF

Hi Bob,

 

is it possible to join chunk files using Apex?

bob_buzzardbob_buzzard

It may be.  You'd have to code this yourself from scratch, so you'd have to know how to join the files together.  You'd also be subject to the 6Mb heap size limit which would probably limit your joined file to a similar size.