pdf upload in angular

  pdfOnload(event) { 

    const file = event.target.files[0];

    const reader = new FileReader();

    reader.readAsDataURL(file);

    reader.onload = () => {

        console.log(reader.result);

         this.base64=reader.result;

    };

  }


 <div class="form-group">

                        <label for="file">Attach1</label>

                        <input type="file"

                               id="file" accept="pdf/*"  

                               (change)="pdfOnload($event)">

                    </div>

Comments

Popular posts from this blog

how to split array as per fixed length, and ionic two dates differences in min,seconds,hours

How to Add Firebase Analytics to Your NativeScript Mobile App