Share via


Handle multiple file uploads

Enabled for Public preview General availability
Users, automatically Apr 5, 2024 -

Business value

When AL developers handle multiple file uploads in Business Central, they add flexibility and usability. This enhancement benefits developers working on applications or customizations that require multiple-file upload functionality. It improves productivity and the user experience for organizations.

Feature details

Developers can handle multiple file uploads. With this improvement, AL developers can create more flexible and user-friendly interfaces within Business Central. When developers designate specific actions, users can upload multiple files at the same time, which improves efficiency.

This feature is especially valuable for developers working on applications or customizations that require users to upload multiple files at the same time.

With the FileUploadAction action, developers use the AllowMultipleFiles property to specify whether an action handles a single file or multiple files. Developers use the AllowedFileExtensions property to specify the file types that users can upload. The OnAction trigger in the FileUploadAction property is called with the list of files.

page 50102 HappyMultiFileUploadPage
{
    PageType = Card;
    SourceTable = Item;
    UsageCategory = Administration;

    layout
    {
        area(content)
        {
        }
    }

    actions
    {
        area(Processing)
        {
            fileuploadaction(ProductImageUpload)
            {
                Caption = 'Upload product image';
                AllowMultipleFiles = true;
                AllowedFileExtensions = '.jpg', '.jpeg', '.png';
                trigger OnAction(Files: List of [FileUpload])
                var
                    CurrentFile: FileUpload;
                    TempInStream: InStream;
                begin
                    foreach CurrentFile in Files do begin
                        CurrentFile.CreateInStream(TempInStream, TEXTENCODING::UTF8);
                        // Code here to handle the file
                        Message('%1 has a length of %2', CurrentFile.FileName, TempInStream.Length)
                    end;
                end;
            }
        }
    }
}

Geographic areas

Visit the Explore Feature Geography report for Microsoft Azure areas where this feature is planned or available.

Language availability

Visit the Explore Feature Language report for information on this feature's availability.

Tell us what you think

Help us improve Dynamics 365 Business Central by discussing ideas, providing suggestions, and giving feedback. Use the forum at https://aka.ms/bcideas.