Example: Retrieving a file from a filespace

You can retrieve a file from a file space by submitting an HTTP request to the WebSphere® MQ Managed File Transfer Web Gateway. The Web Gateway provides the ability to download a file using the HTTP protocol.

About this task

To download a file from a file space, you must be the owner of the file space or have the security role wmqfte-admin. A successful request returns an HTTP status code of 200 and the file.

The following steps describe how to submit a request. In this example, the server hosting the WebSphere MQ Managed File Transfer Web Gateway is example.com. The file that is downloaded is Accounts.csv and the transfer ID of the transfer that sent the file to the file space is 4142452b345f4d2e3c2a333d4ed3e4de43453bc2344a2020. The name of the file space that contains the file is john, and the user requesting the information is authorized to access this file space.

Procedure

  1. Create an HTTP request with the following format:
    GET HTTP/1.1 /filespace/john/4142452b345f4d2e3c2a333d4ed3e4de43453bc2344a2020/Accts.csv
    Host: example.com
    User-Agent: mozilla
    
  2. Submit the request to the Web Gateway. The Web Gateway returns the file in the HTTP response.
    The following headers are set in the HTTP response:
    • Content-Type: application/x-download
    • Content-MD5: 98611a272a27d373f92d73a08cf0d4f4
    • Content-Disposition: attachment; filename="Accts.csv"
    • Content-Length: 8786