You can send a single text file to a destination file system
by submitting a request through the WebSphere® MQ
File Transfer Edition Web Gateway.
About this task
This task demonstrates how to use an HTML form to submit
a file transfer request to the Web Gateway. Using an HTML form is
an alternative to submitting an HTTP request, which is described in Example: Sending a file using an HTTP request.
The example below uses several
optional HTML form fields. For more information on the use of HTML
form fields, see HTTP headers and HTML form fields for using the Web Gateway.
Procedure
- Create an HTML file that includes a form in the following
format:
<form enctype="multipart/form-data"
action="http://example.org/wmqfte/file/agent/AGENT1@QM1/webuploads"
method="POST">
<input type="HIDDEN" name="action" value="overwrite"/>
<input type="HIDDEN" name="type" value="text"/>
<input type="HIDDEN" name="jobname" value="TEST"/>
<input type="HIDDEN" name="priority" value="1"/>
<input type="HIDDEN" name="checksum" value="NONE"/>
<input type="HIDDEN" name="metadata" value="fred=awesome,bob=cool"/>
<input type="HIDDEN" name="metadata" value="lewis=fast,niall=slow"/>
<input type="HIDDEN" name="postdest"
value="[command=D:\postdest.cmd,type=executable,successrc=0]"/>
<input type="HIDDEN" name="postdest-args" value="[fred]"/>
File: <input type="FILE" name="file"/>
<input type="submit" name="Upload" value="Upload" />
</form>
- Open this HTML file in a web browser.
- Enter a file name in the File field,
or click Browse to navigate to it.
- Click Upload to submit the upload
request. The Web Gateway returns an HTTP response with the following
format:
HTTP/1.1 200 OK
Server: WAS/6.0
Content-Length: 0
x-fte-id: 4d63c28ae6e72eb9c51cd812736acd4362ef5
<transfers>
<submission id=”4d63c28ae6e72eb9c51cd812736acd4362ef5”>
</submission>
</transfers>
The value of x-fte-id is
the transfer ID. You can use this transfer ID in an HTTP request for
information about the status of the transfer. For an example request,
see the topic Example: Viewing the status of a file transfer using an HTTP request.