Example: Sending a file using an HTML form

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

  1. 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>
     
  2. Open this HTML file in a web browser.
  3. Enter a file name in the File field, or click Browse to navigate to it.
  4. 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.

Task Task

Feedback

Timestamp icon Last updated: Tuesday, 30 January 2018
http://www.ibm.com/support/knowledgecenter/SSEP7X_7.0.4/com.ibm.wmqfte.doc/web_post_file_html.htm