InboundFile

The InboundFile handler is used to send and receive files.

The HTTP posted content is saved directly to the specified file.

Command

Keyword

Value

Developer notes

RECEIVE

HANDLER

InboundFile

 

TO

value

Required. File path to receive content.

APPEND

*YES

Optional. Append content to existing file.

*NO

Default.

 

Example

RECEIVE HANDLER(InboundFile) TO(/folder/file.jpeg)

 

When the SEND command of this content handler is executed the following steps occur:

1.  Determine the content-type and read the specified file and send the contents as a HTTP response.

2.  If no CONTENT keyword is present, then the Content-Type is determined from the Java Activation Framework FileTypeMap. This is a file extension / MIME type association.

3.  If the HTTP server is an IBM i in MIXED output mode and the content type selected starts with 'text/', the encoding is used to convert the file byte content into Unicode and then convert it back to bytes using the value of the CGI-EBCDIC-CCSID property.

4.  If the HTTP server is in BINARY output mode or the content type does not start with 'text/' then the file contents are sent unaltered.

Syntax:

Command

Keyword

Value

Developer notes

SEND

HANDLER

InboundFile

 

STATUS

value

Optional: HTTP status number.
Default: 200.

MESSAGE

value

Optional: HTTP status message.
Default: OK.

FILE

value

Required. File path of content.

UAPATH

value

Optional. User agent save response path.

UAFILE

value

Optional. User agent save response filename.

UACACHE

value

Optional. Cache-Control max-age.
Default is 0.

UADISPOSITION

value

Optional. Content-Disposition filename.

ENCODING

 

Optional. See ENCODING
Used for MIXED mode content encoding.

CONTENT

 

Optional. See CONTENT.
Content type is obtained from the file type map.

CHARSET

*YES

Optional. Include charset attribute.

*NO

Do not include charset attribute.

*TEXT

Default. Include charset attribute if content is text.

 

Example

SEND HANDLER(InboundFile) FILE(/folder/file.pdf)