Hi,
we use BC20 (On Premise).
We currently store files in Azure File Share. When I upload data, I use a stream and HTTP http request methods.
Azure only allows streams up to 4MB. If the stream is larger, it must be split into chunks.
FileName := FileMgt.BLOBImportWithFilter(TempBlob, 'Choose file', FileName, 'All Files (*.*)|*.*', '*.*');
TempBlob.CreateInStream(InStream, TextEncoding::UTF8);
WriteFrom(InStream);
How can is split the InStream into multiple chunks?
Regards
I finaly found a solution by my own
var
CByte: Byte;
// Copy binary data (byte by byte) from InStream into OutStream
Blob1.CreateOutStream(OutStream);
for i := 1 to ChunkSize do begin
InStream.Read(CByte);
OutStream.Write(CByte);
end;
// Copy OutStream to ChunkStream
Blob2 := Blob1;
Blob2.CreateInStream(ChunkInStream, TextEncoding::UTF8);
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156