You are not logged in.
Pages: 1
I tried to find this option in the documentation, but I failed :-(
I have a class:
TMyJSONData = class(TSynPersistent)
...
published
property Data: TSQLRawBlob read fData write SetData;
end;
I pass some data to the service, on the client side everything is okay, but on the server side I don't get the binary data transmitted.
//CLIENT SIDE
aJPEG.LoadFromFile('C:\Users\Public\Pictures\Sample Pictures\Desert.jpg');
aMyJSONData.Data := StreamToRawByteString(aJPEG);
....
DataImportService.Save(aMyJSONData);
// SERVER SIDE
aDevice.Data -> the property is empty
How do I enable the transfering of the TSQLRawBlob fields?!
The only one thing what I found in the documentation was:
"- by default, TSQLRawBlob properties are serialized as null, unless woSQLRawBlobAsBase64 is defined"
But it was not explained how and where I can do this!
Thx for your help!
Offline
Try with RawByteString type.
I've tried it, the value is still empty. I used the debugger and discovered this code in the unit SynCommons:
function Base64ToBinLength(sp: PAnsiChar; len: PtrInt): PtrInt;
var Table: ^TConvertBase64ToBinTable absolute ConvertBase64ToBin;
begin
if (len=0) or (len and 3<>0) then begin <--- COULD BE THIS CHECK AN ISSUE??
result := 0;
exit;
end;
if ConvertBase64ToBin=nil then
InitConvertBase64ToBin;
if Table[sp[len-2]]>=0 then
if Table[sp[len-1]]>=0 then
result := 0 else
result := 1 else
result := 2;
result := (len shr 2)*3-result;
end;
Offline
AFAIK, in Base64 encoding, the incoming length should always be a multiple of 4 bytes, by design.
To be honestly, I don't know, but the value is still emtpy :-(
Offline
Pages: 1