You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use a UDF to upload and download files to the database server. This works fine, but the filesize of the database increasesby the size of the file which is transfered. I think, that the database server uses the database file as a cache. As we are transfering many very large files this causes problems.
procedure GETFILE(FileName: PAnsiChar; Blob: PBlob);
var
Daten: TMemoryStream;
Buffer: array [0 .. 4096 - 1] of AnsiChar;
count: int;
begin
FillChar(Buffer, SizeOf(Buffer), #0);
Daten := TMemoryStream.Create;
try
Daten.LoadFromFile(StrPas(FileName));
...
Blob^.MaxSegmentLength := SizeOf(Buffer);
count := 1;
while count > 0 do
begin
FillChar(Buffer, SizeOf(Buffer), #0);
count := Daten.Read(Buffer, SizeOf(Buffer));
Blob^.PutSegment(Blob^.BlobHandle, @buffer, count);
end;
...
finally
Daten.Free;
many thanks for your support
Klaus
The text was updated successfully, but these errors were encountered:
It is not a bug, it is how blob works. They are not for transfer between filesystem and client application, they are for storing data in database.
What you want is another feature, like filestream in mssql.
Submitted by: Klaus Mühlböck (1a-archiv)
Relate to CORE3953
Relate to CORE3951
We use a UDF to upload and download files to the database server. This works fine, but the filesize of the database increasesby the size of the file which is transfered. I think, that the database server uses the database file as a cache. As we are transfering many very large files this causes problems.
procedure GETFILE(FileName: PAnsiChar; Blob: PBlob);
var
Daten: TMemoryStream;
Buffer: array [0 .. 4096 - 1] of AnsiChar;
count: int;
begin
FillChar(Buffer, SizeOf(Buffer), #0);
Daten := TMemoryStream.Create;
try
Daten.LoadFromFile(StrPas(FileName));
...
Blob^.MaxSegmentLength := SizeOf(Buffer);
count := 1;
while count > 0 do
begin
FillChar(Buffer, SizeOf(Buffer), #0);
count := Daten.Read(Buffer, SizeOf(Buffer));
Blob^.PutSegment(Blob^.BlobHandle, @buffer, count);
end;
...
finally
Daten.Free;
many thanks for your support
Klaus
The text was updated successfully, but these errors were encountered: