Back to Devexpress

FileAttachmentsOptions.DefaultMaxFileSize Property

expressappframework-devexpress-dot-expressapp-dot-fileattachments-dot-blazor-dot-fileattachmentsoptions.md

latest2.5 KB
Original Source

FileAttachmentsOptions.DefaultMaxFileSize Property

Specifies the maximum size of the file that a user can upload to their browser in bytes. The default value is 4194304L bytes (4 MB).

Namespace : DevExpress.ExpressApp.FileAttachments.Blazor

Assembly : DevExpress.ExpressApp.FileAttachment.Blazor.v25.2.dll

NuGet Package : DevExpress.ExpressApp.FileAttachment.Blazor

Declaration

csharp
public long DefaultMaxFileSize { get; set; }
vb
Public Property DefaultMaxFileSize As Long

Property Value

TypeDescription
Int64

The maximum size of the file that a user can upload to their browser in bytes. The default value is 4194304L bytes (4 MB).

|

Remarks

The following example demonstrates how to specify this property:

File : MySolution.Blazor.Server\Startup.cs.

csharp
using DevExpress.ExpressApp.ApplicationBuilder;
using DevExpress.ExpressApp.Blazor.ApplicationBuilder;
using DevExpress.Persistent.BaseImpl;
// ...
public class Startup {
   // ...
    public void ConfigureServices(IServiceCollection services) {
        // ...
        services.AddXaf(Configuration, builder => {
            builder.UseApplication<MySolutionBlazorApplication>();
            builder.Modules
                // ...
                .AddFileAttachments(options => {
                    options.DefaultMaxFileSize = 2097152;
                });
            // ...
        });
        // ...
    }
}

For more information about file attachments, refer to the following topic: File Attachments (Store Custom Files).

See Also

FileAttachmentsOptions Class

FileAttachmentsOptions Members

DevExpress.ExpressApp.FileAttachments.Blazor Namespace