Invoking file upload event by button

Hi,

I have a button and a file upload components on a view. I want to press the button and call a script which will invoke the file upload components event (open the choise of the file).

Is there a way to do it like this? Can I somehow inwoke events on other components in script (or something else)? Maybe like pressing one button which will also "press" the other one?

Thank you.

See "Classic mistake" in post #2 of Run component A event from component B event.

1 Like

That would be a front-end operation (in the browser), and there's no direct support for supplying the javascript you would need. On top of that, browsers tightly control what can be done with file upload components, as they represent a huge security hole that malware would love to exploit.

Why do you need this?

2 Likes

The file upload component doesnt really suport much customization. I want it to look like a button with my custom text on it. I know some css could fix this but its way more work then doing it as I explained. Also I thought it might be helpful to know for some future use..

If you have some other ways to do it let me know.

Pretty sure this is the reliable/maintainable path forward. Sorry.

Do keep in mind that breaking user's expectations on how browser components look and behave is a recipe for disaster.

1 Like

I didnt find the answer there.

I dont need to change value or count something.I want to open the actual file upload. I dont know if I can somehow access some function that will do it or something. (The actual openong is the problem)

You can't. The file upload component is the only way to do this in a supported manner.