Hi everyone!
I have a strange phenomenon on one of the IS with which I’m working.
I use HTML-pages and output templates for invoking services on the IS. A sketch of the situation:
Package: xyz
In the pub/ directory of the package I have an index.html file.
In that HTML file I offer the possibility to upload a file. The uploaded file is processed by the flow service processReceivedHttpData defined in the package xyz.
The HTML code of the form in index.html looks more or less like this:
...
<form action="/invoke/xyz/processReceivedHttpData"
enctype="multipart/form-data" method="post">
<input name="xmldata" type="file" size="60">
<input type="submit" value="Import">
</form>
...
In the service processReceivedHttpData I set an output template (at design time). I edited the template so that it returns some information about the process.
If I open the index.html and upload the file, the processReceivedHttpData service is executed. I expect an HTML-page as result - from the output template. However, the web-browser does not display an HTML-page, but offers a file for download, after submitting the form. The offered file is, interestingly enough, the HTML-page which should be displayed as the result. If I save it and offer it in a webbrowser it is displayed as expected!
What could be wrong here?
I solved the issue by inserting pub.report:runTemplateOnPipe and pub.flow:setResponse, where I explicitly apply the template that I previously set at design time as output template for the service.
I should be happy that we found this way for solving the issue, however, I’d like to know about the reasons for not getting the response-page displayed in the browser.
I would be pleased if someone could give me hints.
cheers,
christoph