DownloadFromStream with multiple files in Web Client
If is use the "File Management".BLOBExport function in my Extension i can not download multiple files in the same process if i am using the web client. If use the Windows Client then there is a dialog for all files not only the last one. In the debugger he runs DownLoadFromStream for all files but in the end only the last file is downloaded. Is there a fix for that?
Code Example: repeat FileManagement.BLOBExport(TempBlob,RequestedFilename,true); until TempBlob.Next() = 0;
Is this question related to NAv 2018?
Dynamics 365 Business Central Microsoft_Application_12.3.23828.0.app Microsoft_System_12.0.12928.0.app
AL Compiler: 0.16.19969
I had the same problem I "solved" by archiving the files I wanted into a zip archive. If it can help:
local procedure MyProcedure()
var
ZipedFile: OutStream;
FileName: array[4] of Text;
FileContent: array[4] of BigText;
ZipName: Text;
FileMgt: Codeunit "File Management";
FileBlob: Record TempBlob temporary;
ZipBlob: Record TempBlob temporary;
FileStream: InStream;
ZipStream: InStream;
i: Integer;
FillFiles: Report "Fill Files";
begin
FileBlob.Blob.CreateInStream(FileStream);
ZipBlob.Blob.CreateOutStream(ZipedFile);
ZipName := StrSubstNo('%1.zip', "Archive Name");
FillFiles.RunModal();
FillFiles.GetFileContent(FileName, FileContent);
for i := 1 to ArrayLen(FileContent) do begin
FileBlob.WriteAsText(Format(FileContent[i]), TextEncoding::UTF8);
FileMgt.AddStreamToZipStream(ZipedFile, FileStream, FileName[i]);
end;
ZipBlob.Blob.CreateInStream(ZipStream);
DownloadFromStream(ZipStream, 'Dialog', 'Folder', '', ZipName);
end;
@kalberes Do you have any further input for us? The hint with the zip file is working but only as workaround for a short time. Our customers do not want to unzip the files after D365BC created them.
Unfortunately this scenario is not supported now. We will be looking into implementing multi file download in the web client, but we don’t have any timeline to share at this point.
This has been added to the client team backlog.
by ar
Hi Can you please explain about FillFiles: Report "Fill Files"; is it customized if yes then can you please put it here Thanks
Hi,
It's just a report that fills Text and BigText variables (globals). I then use GetFileContent that returns these global variable. It's not necessary and not related to this issue but I let these calls to be more understandable: that's where my file content and file name comes from. You can delete this + the for-loop and hard-code a filename and a filecontent into Text variable to see it work..!
Any updates on this issue? It still seems not to be working. ES Business Central SaaS 16.0 (Platform 16.0.11233.12436 + Application 16.0.11240.11946)
I also find in this version ES Business Central SaaS 16.0 (Platform 16.0.11233.12436 + Application 16.0.11240.11946) that codeunit File Management does not support method FileMgt.AddStreamToZipStream and that codeunit 706 ZIP Stream Wrapper does not exist! How can we manage ZIP files from Cloud?
I also find in this version ES Business Central SaaS 16.0 (Platform 16.0.11233.12436 + Application 16.0.11240.11946) that codeunit File Management does not support method FileMgt.AddStreamToZipStream and that codeunit 706 ZIP Stream Wrapper does not exist! How can we manage ZIP files from Cloud?
Hi, the code above is related to BC12. You are relating to BC16. Have you read the Breaking Changes??
If not - you should! In this document you can see, that the "ZIP Stream Wrapper" was moved to Codeunit "Data Compression".
Hey folks, I tried using Data Compression codeunit to export multiple files, also managed to export/download zip file however zip file that generated is corrupt. I see that data there in zip file, but cannot open it. Anybody else facing such issue?
Any news on this topic? We need to download several files in one process too without zipping them. Show a CONFIRM between the files let me download several files but for the user it is annoying.
In codeunit 242 there are code to print two reports from itemreg and whsreg, respective. But Only print the second record. This is standar functionality, its necessary solution.
update currenly download multiple file and save report to pdf mutifile not working in Version: W1 17.3 (Platform 17.0.20458.24191 + Application 17.3.20469.22477) , have any idea ?
Please try using Compression Mgt. to zip and download files in single zip.. it works just fine.
Or you remove the code for printing multiple documents, for example in warehouse shipment post or get a solution for it. Two years it's a of of time
On Yammer, Andreas Glöckner indicates that changing your browser/settings might enable multiple downloads to work:
But sometimes the browser ask like "the website is triying to download mulitple files. Do you want to allow that?". I think that would be more practial.
Nevertheless, with your answer I looked up my browser (edge) settings and could find a solution that may makes it easier. Want to share it here:
Search for "automatic download" ("automatische downloads").
The first settings says exactly what I wrote in the beginning (see screenshot) but it is not considered by BC? Maybe another setting or a "bug"?
I just added my localhost to allow multiple downloads and suddenly my client downloads multiple files simultaneously :)
Hope this might help.
Both these issues say this is on the client team's backlog. I don't know whether that's still the case, whether they know about this setting, etc. - but maybe it's not fully under their control?
Any news? Allot of customers lauth about BC or don't belive us.
Hi microsoft/al ,
Thank you for your help !! , i will try to do , this case i have to talk with client already , so they will do another way .
Best regards Jirayut (ken)
On Mon, 4 Apr 2565 BE at 18:05 René Gubler @.***> wrote:
Any news? Allot of customers lauth about BC or don't belive us.
— Reply to this email directly, view it on GitHub https://github.com/microsoft/AL/issues/3575#issuecomment-1087416619, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZGXXJFEECCINPN4PGUTGTVDLEIBANCNFSM4FTLZNOQ . You are receiving this because you commented.Message ID: @.***>
