1004
Views
8
Comments
Solved
How find file size from binary data
Application Type
Reactive
Service Studio Version
11.54.8 (Build 62344)

Hi community,

I am using upload block and have the binary data with me, I want to find out the size of file from this binary data.

Please suggest a solution.

Thanks AWL!

UserImage.jpg
Radheshyam Jhare
Solution

Hi @Ashish Lonkar 

Instead of Binary Server Action you can use JavaScript with Some Validation On It

and i have implemented the same in attached OAP Please Check it out.


Thanks and regards

Radheshyam Jhare

BinaryFileSizeCheck.oap
2023-03-16 04-58-56
Ashish Lonkar

This worked for me.

Thanks Radheshyam.



Thanks AWL!

2023-10-27 12-06-14
Asiyah Munawwar

Thanks Radhe !

UserImage.jpg
Ron Ben

Hi,

I tried your solution on a string rather than a file. My string may also contains emoji and there your code fail (the assumption that a text string will be limited to specific language). I'm attaching the screenshot of the error. Can you please suggest a mudification to the JavaScrip that will allow calculating the length in bytes of a string in the general case? 

screenshot.png
2023-03-16 04-58-56
Ashish Lonkar

Hi @Ana Agostinho ,

Actually when I try to use this server action of Binary Data API, I am getting a timeout error for bigger filesize.

Also, I am trying to evaluate file size from the binary data on client.

Do you know how to do this?

Thanks AWL!

2023-01-26 16-03-24
Ana Agostinho
2023-04-16 15-25-31
Krishnanand Pathak

Hi @Ashish Lonkar

You can use BinaryDataSize.



Regards
Krishnanand Pathak



UserImage.jpg
Radheshyam Jhare
Solution

Hi @Ashish Lonkar 

Instead of Binary Server Action you can use JavaScript with Some Validation On It

and i have implemented the same in attached OAP Please Check it out.


Thanks and regards

Radheshyam Jhare

BinaryFileSizeCheck.oap
2023-03-16 04-58-56
Ashish Lonkar

This worked for me.

Thanks Radheshyam.



Thanks AWL!

2023-10-27 12-06-14
Asiyah Munawwar

Thanks Radhe !

UserImage.jpg
Ron Ben

Hi,

I tried your solution on a string rather than a file. My string may also contains emoji and there your code fail (the assumption that a text string will be limited to specific language). I'm attaching the screenshot of the error. Can you please suggest a mudification to the JavaScrip that will allow calculating the length in bytes of a string in the general case? 

screenshot.png
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.