0

how can i set <input type="file"> value from dynamic canvas? i tried $('input[type=file]').val(canvas.toDataUrl()); but nothing works and throw error like this one

Uncaught InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.

Hitori
  • 569
  • 1
  • 5
  • 21

1 Answers1

1

For security reasons, it cannot be done.

Janar
  • 2,623
  • 1
  • 22
  • 32
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). – Raidri May 14 '15 at 19:24
  • 1
    how so? The answer is that it is not possible. – Janar May 15 '15 at 10:39