I can't understand why you are creating mainform for response. If you have something in mainform to serve as response, you should move it to somewhere else.
It is not good idea
Hi
Please set Servermodule.options.soAutoPlatformSwitch to true then both mobile and desktop can use same link.
When mobile user try to access, unigui will forward it to "https://www.example.com/m"
You can define your function with this code.
I mean you can call something like that
UniSession.AddJS('function myFunction(p1, p2) {'+
' return p1 * p2; '+
'} ');
UniSession.AddJS('alert(myFunction(3,5));');
It's mean it will make .zip file downloadable.
You can put on files folder ,you can copy files to cache folder or you can create another folder and put them there