Changes how file is select for the env

These changes are more robust and allow to show more complex example
where there's more that is send via the POST request.