Updated fileopener.js with error callback