2

I'm trying to set an image in file input (HTML input file type) without using the input up-loader (set the file programmatic).

I have found useful links about using the clipboard and data transfer but it is not working on Internet explorer. There is any solution that can be used in Internet explorer?

var dT = new ClipboardEvent('').clipboardData ||new DataTransfer(); // specs compliant (as of March 2018 only Chrome)
dT.items.add(new File(['foo'], 'programmatically_created.txt'));
inp.files = dT.files;
myomyo
  • 51
  • 1
  • 9
  • Have you reviewed [this](https://stackoverflow.com/questions/39854392/attach-file-to-input-type-file-with-javascript) post? – hackape Apr 07 '19 at 08:25

0 Answers0