The InboundFile handler is used to send and receive files.
The HTTP posted content is saved directly to the specified file.
RECEIVE HANDLER(InboundFile) TO(/image-upload/photo.jpeg)
When the SEND command of this content handler is executed the following steps occur:
Determine the content-type and read the specified file and send the contents as a HTTP response.
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.
If the HTTP server is an IBM IBM i in MIXED output mode and the content type selected starts with 'text/', the encoding is used to covert the file byte content into Unicode and then converted back to bytes using the value of the CGI-EBCDIC-CCSID property.
If the HTTP server is in BINARY output mode or the content type does not starts with 'text/' then the file contents are sent unaltered.
SEND HANDLER(InboundFile) FILE(…)