Calling Attach File in Tree View

Has anyone tried calling Attach File Dialog in any view or ex. Tree View?

Like having it in way how these dialogs are called:
https://frappe.io/docs/user/en/guides/app-development/dialogs-types