Kbase P106511: How to output a different content type depending on user entries?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
How to output a different content type depending on user entries?
GOAL:
How to run Webspeed output-content-type function?
GOAL:
How to set the Webspeed page content type?
GOAL:
How to redirect the content type to Excel?
FACT(s) (Environment):
WebSpeed 2.x
WebSpeed 3.x
FIX:
Procedure "output-headers" will be automatically ran by Webspeed when page is submitted:
<HTML>
<HEAD>
<TITLE>Test Program</TITLE>
</HEAD>
<BODY>
<script language="SpeedScript">
PROCEDURE output-headers:
IF GET-VALUE("OutType":U) = "excel":U THEN
DO:
output-content-type("application/vnd.ms-excel":U).
END.
ELSE DO:
output-content-type ("text/html; charset=windows-1252":U).
END.
END PROCEDURE.
</script>
<FORM action="test.html" method="post">
<INPUT name="OutType" type="text" size="12">
<INPUT type="submit" name="submit">
</FORM>
</BODY>
</HTML>