Pular para o conteúdo principal

ResponseBodyAsFile

Structure

ResponseBodyAsFile(sFileName)

Parameters

| Parameter | Type | Description
| sFileName | String | the file name in IndySoft Temp directory that will be used to load the message body of the response |

Return Value

String

Description

Use this function to set a web response message body - as loaded from the sFileName. This sFileName should exist in the IndySoft Temp directory. Important: Set any headers (ResponseHeader) and set the status code (ResponseStatusCode) BEFORE you set the message body response using either ResponseBodyAsText or ResponseBodyAsFile. Note that this procedure will automatically set the 'content-type' header in the web response based on the file extension of the sFileName. You can overwrite this 'content-type' header using ResponseHeader, if desired. The mapping of 'content-type' to file extension is given below:

| File Extension | content-type
| .txt | text/plain.htm | text/html.html | text/html.ini | text/plain.log | text/plain.xml | application/xml.pdf | application/pdf.gif | image/gif.jpg | image/jpeg.jpeg | image/jpg.png | image/png.bmp | image/bmp |

Example

ResponseStatusCode(700)

ResponseBodyAsFile("MyXMLResponse.xml") |