Transfer (paste) files from the clipboard to a file input?

0

I have the following input of files:

<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 it when I select it and press the ctrl + v keys the image that I am in the clipboard to be inserted into this input. Is it possible to do this ??

Note: I'm using VueJS

    
asked by anonymous 03.10.2017 / 18:49

0 answers