Recently I was seeking how to open MS Word file on-the-fly for processing by the python-docx library. By trials and errors I could get the code work. I use web2py framework as a wrapper of POST request.

request here (request.vars[‘file’].value) is web2py framework own core class (global object), containing a full GET or POST request information.

A full controller form procedure: