chrisdaloa icon

Image Capture

chrisdaloa | PRO | 02/25/20 10:22:14 AM UTC | 0 ⭐ | 537 👁️ | Never ⏰ | []
JavaScript |

540 B

|

None

|

0 👍

/

0 👎

//In HTML
<div>
    <img :src="this.dogUrl"   />
</div>               
<div>
    <input type="file" accept="image/*" capture="camera" @change="cattura" ref="nome_foto"  >
 </div>
 
//In Methods
        cattura(event){
            this.selectedFile = event.target.files[0];          
            const fd = new FormData();         
            this.immagine = URL.createObjectURL(this.selectedFile)
            fd.append('image', this.selectedFile, this.selectedFile.name);                          
            this.dogUrl = this.immagine 
        }

Comments