Passing the letter content as a string instead of the parameter file name

Hello,

I am able to send letter using the code provided in http://www.postalmethods.com/resources/samples/java by the method sendLetterAndAddress(desc, letterContent, address). Here, to create an instance of LetterContent we need to pass the file name (exact path) as a parameter. Instead of passing the file name as a parameter, Is there any api which accepts the the file content as a string?

Thanks in advance.

Regards,
Raji.

Comments

I'm not sure I understand

I'm not sure I understand your question. When you run the code, the file - which you provided the path to - is opened, converted to Base64 and sent to the PostalMethods Web Service.

Do you create the file in memory and not on the disk? If so, you could change the java code and provide the file from memory just remember to convert it to Base64 first.

Please let me know if you would like to get an example how to do it.

Hi David, Yes, we create the

Hi David,

Yes, we create the file in memory. Could you please do the corresponding changes in postal methods java so that we can simply call that api which accepts the file content as a string instead of passing the exact file path.

It would be helpful for us if you provide a jar with the necessary changes.

Thanks,
Raji.