The code below works everywhere except on safri mobile. Apparently the onchange is never triggered.
// create a hidden file input element var input = document
I'll be damned: on iOS safari two extra conditions are necessary compared to other browsers:
1) The input must be actually appended to the DOM.
2) setting .onchange won't work: addEventListener must be used instead.