You need to sign in to do that
Don't have an account?
Unable to encode file using Base64 whose size is greater than 11kb
I am trying to send a file as attachment to an Account at salesforce.com using the Java Api. The problem I am facing is that when I send a file of less then 11kb as encoded in base64 it works OK but when I send a file larger than 11K, the file is end to the server but not properly i.e. all bytes of the file are not send. Can there be any problem with the Base64 class or else. Also salesforce api requires files to be send encoded in Base64, so is there any other way to it then the one method I have used in the following code?
File f = new File("Abc.wav");
FileInputStream fis = new FileInputStream(f);
byte[] data = new byte[f.length()];
fis.read(data);
String s = org.apache.axis.encoding.Base64.encode(data);