Problem in Upload to External Database Maria DB

Problem in Upload to External Database Maria DB

  

Hi Everybody,

Our system need to upload file to external database (Maria DB), Maria DB has a BLOB datatype.

From outsystems we are using BinaryToBase64 Converter and then pass the Base64 String to external API.


Here is the code from external API (written in PHP):


file contents from outsystem has been passed through external API but it didn't insert into table. Have I missed something? 


Thanks for your help.

Hi Andre,


I'm not a PHP expert but you might need to "escape" the file content when building the insert statement.


Check this link for more info: https://stackoverflow.com/questions/7052655/insert-blobs-in-mysql-databases-with-php.


Cheers,

Renato


Andre Gunawan wrote:

Hi Everybody,

Our system need to upload file to external database (Maria DB), Maria DB has a BLOB datatype.

From outsystems we are using BinaryToBase64 Converter and then pass the Base64 String to external API.


Here is the code from external API (written in PHP):


file contents from outsystem has been passed through external API but it didn't insert into table. Have I missed something? 


Thanks for your help.



Hi Andre,

This forum is about the OutSystems Platform. It seems your problem is non-OutSystems related, but instead it's in the code from the external API. We cannot help you with that.

Solution

Hi all, 

Thanks for your feedback. I've found that there is no need to encode base64 from binary data, It will encoded automatically. 

From our PHP REST server, just add this line   $stmt->bindParam(':data', $blob, PDO::PARAM_LOB);

And the problem is solved.

Solution