web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Spilt InStream into chunks

(0) ShareShare
ReportReport
Posted on by 7

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 have the same question (0)
  • hubi777x Profile Picture
    7 on at
    RE: Spilt InStream into chunks

    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);

    WriteFrom(ChunkInStream);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,689 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,631

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,212

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans