javascript for triggering upload control not working

I usually use this code to enable BUTTON call the Fileuploader control file upload. But in XOJO 2018 is produce error.

[code]js = “document.getElementById(’”+FileUploader1.ControlID+“form’).appendChild(document.getElementById(’"+btnSelectFile.ControlID+"’));"+
“var chooser=document.getElementById(’”+FileUploader1.ControlID+“form’).getElementsByClassName(‘chooser’)[0];" +
“var input = chooser.getElementsByTagName(‘input’)[0];”+_
“input.accept=’”+mimetype+”’;”+_
“chooser.style.cssText = ‘position: absolute; left: 0px; bottom: 0px; width: "+Str(btnSelectFile.Width)+"px; height: "+Str(btnSelectFile.Height)+"px; overflow: hidden;’;”+_
“input.style.cssText = ‘position: absolute; left: 0px; bottom: 0px; background-color: #FFFFFF;opacity: 0;filter: alpha(opacity=0);width: 100%;height: 100%;’;”+_
“document.getElementById(’”+btnSelectFile.ControlID+"’).appendChild(input);"

ExecuteJavaScript js[/code]

Anybody, use this also?

Xojo, Inc staff are constantly reminding us that hacking the framework to do things outside it’s normal behavior is not supported, and they are under no responsibility to help work out bugs with hacks.

That being said, you can probably figure out what’s going on using the browser developer tools. If you do not know how to use those or correct the issue yourself, you probably shouldn’t be hacking the framework.

What is the error being produced?

Just out of curiosity… why aren’t you just calling FileUploader1.Upload in your Xojo code?

[quote=395476:@Tim Parnell]Xojo, Inc staff are constantly reminding us that hacking the framework to do things outside it’s normal behavior is not supported, and they are under no responsibility to help work out bugs with hacks.

That being said, you can probably figure out what’s going on using the browser developer tools. If you do not know how to use those or correct the issue yourself, you probably shouldn’t be hacking the framework.

What is the error being produced?[/quote]
Right in 2018r1, we upgraded the uploader control to use the newer HTML5 API on all but Internet Explorer (because it’s not working quite right there yet). The form that you’re referring to in that code no longer exists.

FWIW, what we got out of the upgrade was drag and drop, selecting multiple files, mime type filters and upload progress.