Davin said:
Are we confusing returning a file to be downloaded by the browser with using APLWS to send back the contents of a file as if it were returned HTML? I thought that a document-filename is the AWS method of returning the contents of a web page (actual result HTML) in a named file instead of an explicit result. This should never result in a "download" dialog box on the browser, since it should be plain and simple HTML coming back just as if I'd returned it explicitly.
Joe says:
To see the client-browser-side result of using the APLWebServices 'document-filename' action, check out page 15 of the .pdf-format document attached to the following thread:
http://forum.apl2000.com/viewtopic.php?t=359
You will see that using 'document-filename' causes the client-side browser to display a dialog box giving the client options on the disposition of the available content, rather than immediately filling the browser with the content of the server-side file.
Also note in this example the use of the 'document-filename-delete' action that is often associated with the 'document-filename' action. This option is used so that once the client has disposed of the content on the browser side (either by opening, saving or cancelling), the 'document-filename' file is deleted on the server side. I have found that this deletion is sometimes not immediate, but occurs 'eventually' when the server is idle. I believe that this is similar to the strategy, to avoid degrading performance, that is used for updating the APLWebServices log file, i.e. keep the log entries in memory and whenever time permits save them to the physical file.
If the APLWebServices configuration had used 'document' instead of 'document-filename' then the browser would have received the content directly without the intervening dialog box.
Personally, when designing a web application I like to use 'document-filename' which causes the dialog box, because then the result document is opened in another window. In this way the client can see the input window and the result window simultaneously and if necessary, after examining the result window, modify the input window entries, without using a back button, to generate an improved result. Having the result document in another window, also means that the client can have several results on the screen and compare them to decide on the most appropriate result.