ResponseBodyAsFileWithType
Structure
ResponseBodyAsFileWithType(sFileName, sContentType)
Parameters
| Parameter | Type | Description
| sFileName | String | the file name in IndySoft Temp directory that will be used to load the message body of the responsesContentType | String | the content-type value that should be set in response header (based on type of file) |
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. The sContentType parameter will be used to set the 'content-type' header in the web response. Note: if you want the content type to be automatically set based on the file extension then simply use ResponseBodyAsFile.
Example
ResponseStatusCode(700)
ResponseBodyAsFileWithType("MyXMLResponse.xml", "application/xml") |