Skip to content

Commit

Permalink
Merge pull request #52 from dreamfactorysoftware/transform-binary-data
Browse files Browse the repository at this point in the history
Encode binary data using base64
  • Loading branch information
Anas committed Sep 12, 2023
2 parents 78127d3 + 12b4b4b commit 3422fe1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Components/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -1976,6 +1976,9 @@ public function typecastToClient($value, $field_info, $allow_null = true)

$type = strtolower(strval($type));
switch ($type) {
// Convert the binary data into a base64 encoded string so we can json encode it later for the response
case DbSimpleTypes::TYPE_BINARY:
return base64_encode($value);
// special handling for datetime types
case DbSimpleTypes::TYPE_DATE:
case DbSimpleTypes::TYPE_DATETIME:
Expand Down

0 comments on commit 3422fe1

Please sign in to comment.