mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-09 07:27:46 +02:00
* Server returns base64 encoded blob data
This commit is contained in:
parent
3a45781c1c
commit
c0d1ebde37
@ -125,6 +125,7 @@ Type
|
||||
Constructor Create(aOwner : TComponent); override;
|
||||
Destructor Destroy; override;
|
||||
Class Function DefaultBlobDataToBytes(aValue : JSValue) : TBytes; override;
|
||||
Class Function DefaultBytesToBlobData(aValue : TBytes) : JSValue; override;
|
||||
Function ParamByName(const aName : String) : TQueryParam;
|
||||
Published
|
||||
// Connection to use to get data
|
||||
@ -524,6 +525,12 @@ begin
|
||||
Result:=BytesOf(Window.atob(String(aValue)));
|
||||
end;
|
||||
|
||||
class function TSQLDBRestDataset.DefaultBytesToBlobData(aValue: TBytes
|
||||
): JSValue;
|
||||
begin
|
||||
Result:=Window.Btoa(StringOf(aValue));
|
||||
end;
|
||||
|
||||
function TSQLDBRestDataset.ParamByName(const aName: String): TQueryParam;
|
||||
begin
|
||||
Result:=TQueryParam(Params.ParamByName(aName));
|
||||
@ -644,6 +651,7 @@ begin
|
||||
FSQL:=TStringList.Create;
|
||||
TStringList(FSQL).OnChange:=@DoSQLChange;
|
||||
FParams:=CreateQueryParams;
|
||||
BlobFormat:=bfBase64;
|
||||
end;
|
||||
|
||||
destructor TSQLDBRestDataset.Destroy;
|
||||
|
Loading…
Reference in New Issue
Block a user