Getting parameters of method POST with cgi

I got a web page loaded in the connectport x8 that sends some information using the POST method and calls a pih file (also loaded) in the action. Then, the pih file is supposed to get those variables and process them using the digicli module. I had to upload the module in the CP x8 because it was not supported by the gateway, so now i can import it.

So far the code in the pih file is something like this:
<% #!/usr/local/bin/python %>
<% import cgi %>
<% import cgitb %>
<% cgitb.enable() %>
<%= cgi.print_environ() %>
<% form=cgi.FieldStorage()%>
<%= form %>
<% ni=form.getvalue(“name”)%>
<%= ni%>

But it won’t show anything, the result is: NoneFieldStorage(None, None, []) None

I believe I need a directoy /cgi-bin/ to get this working, is that right? do i need a web server in the CP x8? if this is correct, how can I implement it?

What am I doing wrong? is there any other way to get this working?
Thank you.


try this:

im guessing you need web service hanlder. upload code to gateway ( example), run it in terminal or ssh environment, leave it running. try running .pih again - just dont forget to delete the full path in your browser:
NOT - ip.ip.ip.ip/FS/WEB/python/testfile.pih
-> ip.ip.ip.ip/testfile.pih

this “miracle” costed more then a week of trying. hope that helps.