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
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
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.
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
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
Yes, I can see that it works. But I was wondering how that number is arrived 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
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
146,702
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,015
Most Valuable Professional