Example: Deleting a file from a file space
You can delete a file from your file space by submitting
an HTTP request to the WebSphere® MQ Managed File Transfer Web
Gateway. If you set the header x-fte-include-file-in-response
to true
,
the contents of the file are returned in the HTTP response from the
Web Gateway.
About this task
wmqfte-admin
can
delete a file from a file space, but cannot receive the contents of
the deleted file. If a user with the security role wmqfte-admin
attempts
to delete a file and request the file contents, the request fails
with a resource error. For more information, see User roles for the Web Gateway.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 name of the file space is jack
, it contains a
file report.txt, and the user requesting the
file deletion is the owner of the file space. The transfer ID 414d5120514d5f67617265746862202067732c4c20c25a03
is
the hexadecimal ID of the transfer that put the file in the file space,
and this ID is returned when you list the contents of a file space.
For more information about the format of file space query responses,
see File space query response formats.
The
header x-fte-include-file-in-response:true
specifies
that the contents of report.txt is returned in
the body of the response. If you do not specify the value of this
header, it defaults to false
and the file is deleted
but its contents are not returned.