rest attachment api with Base 64 limitation ?

udaykulal
Giga Contributor

Hi All

When we use the REST API Attachment creator to conver the image to Base 64 and post it to external sysem, it only transfers upto 4MB file size. Any file larger than this does not get transfered.

Our client accepts only Base64 encoded data. When i contact Hi support, i got a response that REST API supports only binary and multipart and only SOAP support Base64.

However I can clearly say that REST API does support Base64 upto 4mb. Am i making sense? Is there a way around to get away with this limitation with the file format keeping as Base64 ?

Your quick response is much appriciated.

regards

Uday

4 REPLIES 4

snehabinani26
Tera Guru

snehabinani26
Tera Guru

Hi Uday,



If your question is answered , please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.


Hi Sneha



My question was not answered. That is why I marked your reply as helpful.



On 11-May-2017 5:52 PM, "snehabinani26" <community-no-reply@servicenow.com>


ivanovs
Giga Contributor

Hi Uday,



I beleive the issue you are experiencing is the same one I experienced a year ago. I assume you have a staging table? If so the field that received the xml data is in effect limited up to 5 megabytes (if you are using the default settings for the table after half a megabyte the xml will just state "see attachment" and an attachment will actually contain the field data but even if you get the attachment using the standard way you will still be limited to about 5MB or so).There is a workaround for this which I assume you already implemented (going to the attachment of the record on the staging table and getting the content) to get the attachment but there is another workaround which can work easily with files larger than this limit - please see this post here: GlideSysAttachment().getBytes() is not working if size of attachment is more than 5 MB?   and note the last answer from Ben which uses this approach: RESTAPIResponseStream - writeStream(Object stream) I hope this information is useful.