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

Notifications

Announcements

Community site session details

Community site session details

Session Id :

Dynamic Business Central 365: AllowedFileExtensions Property

Khushbu Rajvi. Profile Picture Khushbu Rajvi. 21,042 Super User 2025 Season 2

When building file upload functionality in Microsoft Dynamics 365 Business Central, controlling what kind of files users are allowed to upload is a critical requirement. This is where the AllowedFileExtensions property becomes extremely useful.

Introduced with runtime version 13.0, the AllowedFileExtensions property allows developers to explicitly restrict the file types that users can upload through a Page File Upload Action. This helps enforce data integrity, improve security, and provide a better user experience.

What Is the AllowedFileExtensions Property?

The AllowedFileExtensions property specifies a comma-separated list of file extensions that a user is permitted to upload or drag into a file upload drop zone.

If a user attempts to upload a file with an extension not included in this list, Business Central will automatically block the action.

This property is only applicable when using file upload actions on pages.

Syntax

AllowedFileExtensions = '.jpg','.jpeg','.png';

Practical Example

Suppose you are building a page where users are allowed to upload image files only (for example, item images, inspection photos, or profile pictures).

 fileuploadaction(UploadMultipleFiles)
            {
                Caption = 'Upload Multiple Files';
                ApplicationArea = All;
                AllowMultipleFiles = true;
                AllowedFileExtensions = '.jpg', '.jpeg', '.png';

                trigger OnAction(Files: List of [FileUpload])
                var
                    F: FileUpload;
                    InS: InStream;
                    RecUpload: Record "KR Import Demo"; // change to your upload table
                begin
                    foreach F in Files do begin
                        F.CreateInStream(InS);

                        RecUpload.Init();
                        RecUpload.Description := F.FileName; // example
                                                             // RecUpload."File Content".ImportStream(InS, F.FileName); // if you have a Blob
                        RecUpload.Insert();
                    end;
                end;
            }

Each file extension:

  • Must start with a dot (.)

  • Must be enclosed in single quotes

  • Must be separated by commas

Important Notes and Limitations

  • The validation is based only on file extension, not on file content.

  • This property does not replace server-side validation if your solution requires deeper file inspection.

  • It is available only from runtime version 13.0 onward.

  • The property does not apply to older upload patterns that do not use Page File Upload Actions.


Thanks For Reading...!!😊

Regards,
Khushbu Rajvi

This was originally posted here.

Comments

*This post is locked for comments