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
Post a Comment