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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

DownloadfromStream multiple files BC SaaS v16

(0) ShareShare
ReportReport
Posted on by 574

Hi, I am trying to download all pictures from item table and I found three issues I cant workout:

1. I am using a REPEAT/ UNTIL loop, but the Downloadfromstream only downloads the last picture (this seems to be a pending issue as I read in github). Is there a way to download all pictures in the table and not the last one?

2. Is there a way to have downloadfromstream without prompting the user to confirm the downloading folder? (I am in BC16 Cloud)

3. Is there a way to have this pictures saved in a shared folder?

Thanx

Code:

 with item do begin
   FindFirst();
            repeat
                if Picture.Count > 0 then
                    for Index := 1 to Picture.Count do begin
                        if TenantMedia.Get(Picture.Item(Index)) then begin
                            TenantMedia.calcfields(Content);
                            if TenantMedia.Content.HasValue then begin
                                FileName := "No." + '-' + format(Index+ GetTenantMediaFileExtension(TenantMedia);
                                TenantMedia.Content.CreateInStream(PicInstream);
                                DownloadFromStream(PicInstream, '''''', FileName);
                            end;
                        end;
                    end;
            until (next() 0;
end;
I have the same question (0)
  • Verified answer
    THE Italian Profile Picture
    on at

    1. This is a known limitation of web client. See github.com/.../3575

    2. Not that I am aware of. See https://docs.microsoft.com/en-us/dynamics-nav/downloadfromstream-function--file-. Good candidate for IDEAS site https://ideas.dynamics.com/ideas/

    3. You could save it in a blob storage and use power automate to synchronize with a shared folder or use SFTP like https://demiliani.com/2020/03/30/dynamics-365-business-central-saas-save-a-file-to-an-sftp-server/

  • Verified answer
    JJMc Profile Picture
    291 on at

    If you make the current page (in wich you are downloading the files) to lose the focus, the download dialog appears.

    What I've done is show a page (not a confirm dialog) asking the user to press ok when the file as been downloaded.

    I haven't found another way.

  • Lars Svane Profile Picture
    5 on at

    DownloadFromStream(FileInStream, '', '', '', DownloadFileName);

    if confirm(SaveFileMsg + ' ' + DownloadFileName) then;

    Works for me in Edge browser, all files are downloaded

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans