Example: Sending a file using an HTTP request
You can send a single file to a destination agent file system by submitting a request through the IBM® MQ Managed File Transfer Web Gateway.
About this task
File contents can be uploaded to any standard IBM MQ Managed File Transfer agent as POST
data
using the multipart/form-data Content-Type
. This
should be submitted to a location containing the target agent and
file destination in the following format: /fte/file/agent/agent_name@queue_manager/filepath.
You can modify the file transfer request parameters using the custom
HTTP headers described in HTTP headers and HTML form fields for using the Web Gateway.
When you submit a file transfer request using the Web Gateway, your user ID in the application server environment is checked to see if it is mapped to a WebSphere® MQ Message Descriptor (MQMD) user ID. The mappings between application server user ID (web user ID) and MQMD user ID are created by your Web Gateway administrator. For more details, see the topic Example: Mapping web user IDs to MQMD user IDs. If there is no MQMD user ID defined for your web user ID, the value of the defaultMQMDUserID servlet initialization parameter is used. This parameter is defined during deployment of the Web Gateway application.
Use the following example to transfer a text file to the destination file path destination-root-path/temp and destination file name myfile.txt on the destination agent ACCOUNTS. Use an MD5 checksum to check the integrity of the transferred file. The content of the file is:
Account No, Balance
123456, 100.00
234567, 1022.00
345678, 2801.00
456789, 16.75
The server hosting the IBM MQ Managed File Transfer Web Gateway is example.com.