0
I got the following input
archival:
<input class="botao" @change="carregarFoto" type="file" name="photo" accept="image/*">
<img :src="foto" style="width:192px;height:108px;" />
carregarFoto (e) {
var arquivo = e.target.files
if (!arquivo[0]) {
return
}
var data = new FormData()
data.append('media', arquivo[0])
var reader = new FileReader()
reader.onload = (e) => {
this.foto = e.target.result
}
reader.readAsDataURL(arquivo[0])
}
And I want when I select it and press the keys ctrl
+ v
the image I am in the clipboard is inserted into that input. It is possible to do this??
Note: I am using Vuejs
Here is the link to the solution you need: https://stackoverflow.com/questions/8000420/force-paste-event-to-encode-images-in-base64.
– Bruno Rigolon
Very good, please add as an answer so that I can accept and if someone looks for the same question can find the solution
– LeonardoEbert
You can post it, I don’t have time to write a full answer, but I’m glad I could help.
– Bruno Rigolon
Okay, I’ll write you an answer, if you feel the need to edit, feel free...
– LeonardoEbert