Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps

File Size Conversion question

(0) ShareShare
ReportReport
Posted on by

https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-limit-the-size-of-image-in-add-picture-control-to-less/td-p/483934

 

Text(Len(vImg)*.00000073,"[$-en-US]##.##") & " Mb"

I'm converting a file size to Mb and found the link above.

 

Can someone tell me why we multiply by .00000073?

Thanks

 

  • Verified answer
    WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Re: File Size Conversion question

    Hi @Brianmaric ,

    I am not sure how I can be more specific than It is the relationship between the original size of a binary file and its size when converted to Base64 Text using JSON.

    Obviously someone has done some testing and concluded that this is the relationship factor. 

     

  • WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Re: File Size Conversion question

    Hi @Brianmaric ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Re: File Size Conversion question

    Hi @Brianmaric ,

    It is the relationship between the original size of a binary file and its size when converted to Base64 Text using JSON.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • CU01050835-0 Profile Picture
    on at
    Re: File Size Conversion question

    Yes, I can see that it works.  But I was wondering how that number is arrived at.  

  • WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Re: File Size Conversion question

    Hi @Brianmaric ,

    Add an Add picture control to your screen, a Button and a Label

    Upload a file of known size and then put this on the Button (note UploadedImage1 may be different if you have another of these controls already in your app.

    UpdateContext(
     {
     varImage: 
     JSON(
     UploadedImage1.Image,
     JSONFormat.IncludeBinaryData
     )
     }
    )

    and this on the label

    Len(varImage)

    now compare the number in the label with the size of your file

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • WarrenBelz Profile Picture
    146,702 Most Valuable Professional on at
    Re: File Size Conversion question

    Hi @Brianmaric ,

    When an image is stored in Power Apps from (example) a camera control, it is in a format called dataUri which is actually text and the number of characters has a direct relation to the file size.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard