File columns
Use file columns to store file data up to a specified maximum size. A custom or customizable table can have zero or more file columns. This article is about working with column definitions in code. To use data stored in these columns, see Use file column data.
Create file columns
The recommended way to create file columns is to use Power Apps and define your columns using the designer. More information: File columns.
Note
A key consideration when creating file columns is the Maximum file size stored in the MaxSizeInKB
property. The default setting for this is 32768
, or 32 MB. The maximum value is 10485760
KB (10 GB). While the API can handle files up to 10 GB in size, Power Apps client controls currently only support files up to 128 MB. Exceeding the 128 MB value when using these controls will result in errors uploading or downloading files.
The MaxSizeInKB
value cannot be changed in Power Apps using the designer after you create the file column.
You can use the API to update the MaxSizeInKB
property. More information: Update a column using Web API and Update a column using SDK
You can also create file columns using the Dataverse SDK for .NET or using the Web API. The following examples show how:
Use the FileAttributeMetadata Class with the CreateAttributeRequest Class to create a file column.
public static void CreateFileColumn(
IOrganizationService service,
string entityLogicalName,
string fileColumnSchemaName)
{
FileAttributeMetadata fileColumn = new()
{
SchemaName = fileColumnSchemaName,
DisplayName = new Label("Sample File Column", 1033),
RequiredLevel = new AttributeRequiredLevelManagedProperty(
AttributeRequiredLevel.None),
Description = new Label("Sample File Column for FileOperation samples", 1033),
MaxSizeInKB = 30 * 1024 // 30 MB
};
CreateAttributeRequest createfileColumnRequest = new() {
EntityName = entityLogicalName,
Attribute = fileColumn
};
service.Execute(createfileColumnRequest);
}
Use the FileAttributeMetadata.MaxSizeInKB property to set the maximum size.
More information:
Blocked file types
You can control which types of files aren't allowed to be saved in file columns. More information: Block certain types of files
Restrictions with Customer Managed Keys (CMK)
Important
Some restrictions apply when using the File and full-sized Image data-types in Dataverse. If Customer Managed Keys (CMK) is enabled on the tenant, IoT data-types are not available to the tenant's organizations. Solutions that contain excluded data-types will not install. Customers must opt-out of CMK in order to make use of these data-types.
All CMK organizations as of version: 9.2.21052.00103 can support the use of the Dataverse File and Image data-types. Files within CMK organizations are limited to a maximum size of 128MB per file. All files and images within CMK organizations will be stored in the Dataverse relational storage, instead of Dataverse File Blob storage. Other limitations:- User Delegation SAS Downloads are not supported
- Chunking uploads and downloads are limited to a single chunk
See Also
Feedback
Submit and view feedback for