Remote robot control - return value and sending file questions

Hi,
I am trying to remotely control a UR10e via TCP/IP and so far I am using the primary interface(port 30001) and I would like to ask a few things.

Is it possible to receive a return value of the sent script on the connection? That is if I have for an example function
def test() return “test” end
is it then possible to receive the “test” as a response on the same connection?

The other question is if it is possible to upload files on the UR10e through any of the provided connections? Concretely I need to remotely send and save a program that can be loaded in the Universal Robots Graphical Programming Environment.