# Validate Download Size

**URL:** <https://forum.ionicframework.com/t/validate-download-size/142406>\
**Category:** Ionic Native\
**Created:** [September 21, 2018, 6:40am UTC](https://forum.ionicframework.com/t/validate-download-size/142406 "2018-09-21T06:40:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrikd](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@patrikd](https://forum.ionicframework.com/u/patrikd)\
**Post date:** [September 21, 2018, 6:40am UTC](https://forum.ionicframework.com/t/validate-download-size/142406/1 "2018-09-21T06:40:28Z")

</div>

Hi all,  
I’m trying to solve a simple problem but it seems in js it’s not that simple as expected ☹  
I have an app (Android, iOS) which is playing some videos which are downloaded from a server and locally stored.  
For the download I use the FileTransferObject from ‘@ionic-native/file-transfer’ which works like expected.

```auto
      await fileTransfer.download(source, this.filepath + dest)
      .then((entry) => {
        console.log('loaded: ' , entry );

          entry.file(function (file) {
            var reader = new FileReader();
    
            reader.onloadend = function() {
              
              console.log("Successful file read: " + this.result);
              let tmp: ArrayBuffer = this.result;              
              console.log('tmp.byteLength: ', tmp.byteLength)
            };
    
            reader.readAsArrayBuffer(file);
         });  
        }

```

At the end of the download I want to validate the local stored filesize against my stored file info which also has the size of the original file.  
FileReader has not such a property and the byteLength is not the filesize.  
Any hints how to get the size of a local stored file?  
thx,  
patrik

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:16pm UTC](https://forum.ionicframework.com/t/validate-download-size/142406/2 "2021-07-19T21:16:16Z")

</div>

Closed on July 19, 2021, 9:16pm UTC


