Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

Increase maximum file fize limit for a "File" Column in Dataverse

(0) ShareShare
ReportReport
Posted on by 187

Hello,

 

I have a Power Apps and Power Pages project in production for a while that uses Microsoft Dataverse and I have encountered a limitation that I am trying to resolve.

 

In my schema, I have a column of type "File" for which the "Maximum file size" is set to 32MB. I need to increase this limit to accommodate larger files, but the option to edit this setting is grayed out in the column properties.

 

Is there a simple way to increase the file size limit beyond 32MB for an existing "File" column in Dataverse ?

 

I appreciate any guidance or suggestions you might have on how to address this issue.

Thank you !

Charles

Categories:
  • CharlesPP Profile Picture
    187 on at
    Re: Increase maximum file fize limit for a "File" Column in Dataverse

    Hello,

    I'd like to reopen the subject.


    Do you have any idea why I'm getting the 401 Unauthorized error with the following code? I did create an Azure AD application with the Dynamics CRM.user_impersonation permission.

     

    Here is the code used to generate the token:

    public static async Task<string> GetToken(string tenantId, string clientId, string clientSecret, string instanceUrl)
     {
     using (var client = new HttpClient())
     {
     string url = $"https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token";
    
     var data = new Dictionary<string, string>
     {
     ["client_id"] = clientId,
     ["scope"] = $"{instanceUrl}/.default",
     ["client_secret"] = clientSecret,
     ["grant_type"] = "client_credentials"
     };
    
     var request = new HttpRequestMessage(HttpMethod.Post, url) { Content = new FormUrlEncodedContent(data) };
    
     var response = await client.SendAsync(request);
     if (!response.IsSuccessStatusCode)
     {
     Console.WriteLine($"Error obtaining token: {response.StatusCode}");
     return null;
     }
    
     var json = await response.Content.ReadAsStringAsync();
     var tokenResponse = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
    
     return tokenResponse != null && tokenResponse.ContainsKey("access_token") ? tokenResponse["access_token"] : null;
     }
     }
     }

     

    Many thanks in advance !

    Charles

  • CharlesPP Profile Picture
    187 on at
    Re: Increase maximum file fize limit for a "File" Column in Dataverse

    Thank you @AhmedSalih @for your reply, which sounds promising!

    However, I can't get the result I'm looking for. I've written the code below, but I get a 401 (Unauthorized) error on the first request.
    To obtain the token, I created an Azure AD application with Dynamics CRM -> user_impersonation permissions.

    Here's the C# code I used:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net.Http.Headers;
    using System.Net.Http;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace Change_Dataverse_file_column_max_size
    {
     internal class Program
     {
     static async Task Main(string[] args)
     {
     await UpdateColumn();
     }
    
     private static async Task UpdateColumn()
     {
     using (HttpClient client = new HttpClient())
     {
     client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "[my_token]");
     client.DefaultRequestHeaders.Add("OData-MaxVersion", "4.0");
     client.DefaultRequestHeaders.Add("OData-Version", "4.0");
     client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
    
     string instanceUrl = "https://[my_org].crm12.dynamics.com";
     string tableName = "cg_commande";
     string columnName = "cg_fichierstl";
    
     string attributeUrl = $"{instanceUrl}/api/data/v9.2/EntityDefinitions(LogicalName='{tableName}')/Attributes(LogicalName='{columnName}')/Microsoft.Dynamics.CRM.ImageAttributeMetadata";
    
     // Get existing attributes
     HttpResponseMessage response = await client.GetAsync(attributeUrl);
     response.EnsureSuccessStatusCode();
     string attributeJson = await response.Content.ReadAsStringAsync();
    
     // Update the column by changing the MaxSizeInKB property and then sending a PUT request with the updated JSON
     attributeJson = attributeJson.Replace("\"MaxSizeInKB\": 32768", "\"MaxSizeInKB\": 65536");
     HttpContent content = new StringContent(attributeJson, Encoding.UTF8, "application/json");
     HttpResponseMessage updateResponse = await client.PutAsync(attributeUrl, content);
     response.EnsureSuccessStatusCode();
    
     Console.ReadKey();
     }
     }
     }
    }

     Thanks in advance!
    Charles

  • CharlesPP Profile Picture
    187 on at
    Re: Increase maximum file fize limit for a "File" Column in Dataverse

    Thanks @Rahman1005 , but I have the impression that this article explains the change at column creation, not at editing.

  • CharlesPP Profile Picture
    187 on at
    Re: Increase maximum file fize limit for a "File" Column in Dataverse

    Thank you @GuidoPreite for this proposal, which seems feasible and not too risky!

  • AhmedSalih Profile Picture
    6,678 Super User 2025 Season 1 on at
    Re: Increase maximum file fize limit for a "File" Column in Dataverse

    Hello, @CharlesPP, to add to what what @GuidoPreite, has mentioned, 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. Update a column using Web API and Update a column using SDK

     

    More information: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/create-update-column-definitions-using-web-api#update-a-column

     

     


    If my reply helped you, please give a 👍 If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it more.

    Visit my Blog: ahmedsalih.blog

    Visit my YouTube Channel: https://www.youtube.com/@powerplatformplace/videos

    Microsoft Business Application MVP

  • Rahman1005 Profile Picture
    109 on at
    Re: Increase maximum file fize limit for a "File" Column in Dataverse

    Hi,

    Could you please refer below article to increase file size

    https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/How-to-Increase-File-Column-Size-in-Dataverse/ba-p/1803670

  • Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on at
    Re: Increase maximum file fize limit for a "File" Column in Dataverse

    the size cannot be changed after it has been created, so the field should be deleted and recreated.

    there is a post explaining another approach to update the value

    https://www.c-sharpcorner.com/article/update-size-of-file-column-in-dataverse-table/

    but I don't know if it still work (so my suggestion will be to delete and recreate the field)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 19

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 15 Super User 2025 Season 1

Overall leaderboard

Featured topics