Delphi 预期Blob获得Clob rest服务
在数据库中,我有列blob,我需要使用rest服务将图像从设备发送到数据库 在rest服务中,我有参数PAR_BLOB,我尝试将字节转换为字符串并得到错误 预期的Blob变为ClobDelphi 预期Blob获得Clob rest服务,delphi,firemonkey,rad-studio,Delphi,Firemonkey,Rad Studio,在数据库中,我有列blob,我需要使用rest服务将图像从设备发送到数据库 在rest服务中,我有参数PAR_BLOB,我尝试将字节转换为字符串并得到错误 预期的Blob变为Clob 或者其他解决方案?这个问题可能与你的问题相同,请阅读他的解决方案:并让我知道。@fpiette Tnx,但没有解决我的问题! function BytesToStr(abytes: tbytes): string; var abyte: byte; begin for
或者其他解决方案?这个问题可能与你的问题相同,请阅读他的解决方案:并让我知道。@fpiette Tnx,但没有解决我的问题!
function BytesToStr(abytes: tbytes): string;
var
abyte: byte;
begin
for abyte in abytes do
begin
Result := result + IntToStr(abyte) + ',';
end;
Result := '[' + Copy(Result, 1, Length(Result) - 1) + ']';
end;
ABytes := TFile.ReadAllBytes('/storage/emulated/0/DCIM/Camera/IMG_20210410.jpg');
RESTrequest1.Params.AddItem('PAR_BLOB',BytesToStr(ABytes), pkREQUESTBODY, [], ctAPPLICATION_JSON);