pickle is a python function, when you do pickle.load you are loading a python data type.
It's not possible to do this directly from your Ui designer, that is not compatible with Python.
In the UI designer you can use mainly angular-js and javascript libraries.
You can try to use jpickle library: https://www.npmjs.com/package/jpickle , a javascript library. Once you understand how it works from the documentation try to add it as an asset in the UI designer and play with it.
You mention JavaScript, so I assume you are trying to do it in a form. I don't know if it can help in your use case, but you can use a file widget on your form and let the user select and upload the file.
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.