[Data Grid] Binary Data error when send JSON

Forge Component
(36)
Published on 17 Mar (13 days ago) by OutSystems R&D
36 votes
Published on 17 Mar (13 days ago) by OutSystems R&D

Hi,

When i tried use Sample_Employee data, it has Binary data and when send JSON,

it generates errors because Binary data is displayed as text and there exceeded length.

Maybe it didn't convert (TextToBinaryData) before send JSON.


How can i fix it?

Regards,

Solution

Huyen IT wrote:

Hi,

When i tried use Sample_Employee data, it has Binary data and when send JSON,

it generates errors because Binary data is displayed as text and there exceeded length.

Maybe it didn't convert (TextToBinaryData) before send JSON.


How can i fix it?

Regards,

Hi Huyen,

We had faced similar issue with images. However we took a workaround to resolve it.
Before sending the data with JSON, we converted them to base64 string.

BinaryToBase64()

And later before storing to DB convert back from base64 string to binary if the image datatype is binary.

Base64ToBinary()


Somehow we found issues with BinaryDataToText and TextToBinaryData and hence recommend not using it.

BinaryDataToText()
TextToBinaryData()


Regards,

Saugat


Solution

Saugat Biswas wrote:

Huyen IT wrote:

Hi,

When i tried use Sample_Employee data, it has Binary data and when send JSON,

it generates errors because Binary data is displayed as text and there exceeded length.

Maybe it didn't convert (TextToBinaryData) before send JSON.


How can i fix it?

Regards,

Hi Huyen,

We had faced similar issue with images. However we took a workaround to resolve it.
Before sending the data with JSON, we converted them to base64 string.

BinaryToBase64()

And later before storing to DB convert back from base64 string to binary if the image datatype is binary.

Base64ToBinary()


Somehow we found issues with BinaryDataToText and TextToBinaryData and hence recommend not using it.

BinaryDataToText()
TextToBinaryData()


Regards,

Saugat


Thanks Saugat Biswas,

This is the solution, but in my case, it should be handled in Data GridFramework.