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 :
Power Platform Community / Forums / Power Apps / File Size Conversion q...
Power Apps
Unanswered

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

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    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

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    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

     

  • CU01050835-0 Profile Picture
    on at

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

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    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

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    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

  • Verified answer
    WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    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. 

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard