It is not possible for a Web application to stream a file to the browser and subsequently
send additional information in the same response. This limitation is a consequence
of the request-response nature of Web programming and is not specific to OfficeWriter.
The same limitation applies to any Web application which performs media streaming
or file downloading.
The Http protocol mandates that there can be only one response to each request.
A response consists of Http headers and content. The Http headers provides information
about the file and optionally specifies how it should be handled. In the case of
file downloading, the response's content must contain only file data. If there are
non-file data in the response, such as HTML code to update the Web page or perform
additional actions, the foreign data would be taken to be part of the file, causing
the file to be corrupted.
After a Web application streams a file to the browser using OfficeWriter's Save method, attempting to redirect to another Web page may generate the following error: "Cannot redirect after HTTP headers have been sent". This is because OfficeWriter's Save method sets the appropriate Http headers before streaming the file and the instruction to redirect requires another set of Http headers. |