You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to change the file attribute , to display filesize in KB for custom file picker.

edited Jul 6, 2019 7:55PM in Visual Builder 3 comments

Content

Hi

I am trying to change and display the file size from B to KB.

But value is not getting changed.

PFB the JS code for the same.

self.selectListener = function(event) {
            var files = event.detail.files;
            self.files1=ko.observableArray([]);
            self.files1=files;

 if(files[index].size>999)
                {
                  self.files1[index].size=((files[index].size)/1000);
                }
                self.fileNames.push(self.files1[index]);

But value of self.files1[index].size is not getting divided by 1000 , means not getting changed.

All this is a part of custom component.

Please let me know if any other details are required.

Thanks,

Himanshu Sethi

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!