Avoid "Maximum call stack size exceeded"

Fix the click method to choose files and avoid the javascript error
«Maximum call stack size exceeded»