Example: Creating a file space
Before a file can be transferred to a user file space, you must create a file space for that user. You can create a file space by using the WebSphere® MQ Managed File Transfer Web Gateway.
About this task
Use the Web Gateway administration API to request the creation of a user file space. For more information about the format of a file space creation request, see File space create or alter request format. A successful request returns an HTTP status code of 200.
You must have either the wmqfte-filespace-create
role
or the wmqfte-admin
role associated with your user
account to create a file space. For more information about security
roles for the Web Gateway, see User roles for the Web Gateway and Attempting to create a file space without the required authority.
If you have the security
role wmqfte-admin
, you can also create a file space
by using the administrative console. For more information, see Web Gateway administrative console.
The following steps
describe how to submit a POST request to create a file space. In this
example, the server hosting the Web Gateway is example.com
and
the HTTP request is submitted using a web browser that identifies
itself as mozilla
. The name of the file space and
the name of the user who owns the file space is andrew
and
the file space can take up a maximum of 1,048,576 bytes on the file
system. The user bill
and any user whose user name
matches the regular expression pattern fte.*
are
authorized to send files to the file space. The user clive
is
not authorized to access the user file space. You can use Java regular expressions to pattern-match either
or both sets of the users in the authorized
and unauthorized
XML
sections. For more information, see Regular expressions used by WebSphere MQ Managed File Transfer.
In
the following example, one of the agent-user
entries
in the authorized
section uses the regular expression fte.*
.
This regular expression matches any user names starting with fte
.
In the situation that you wanted to authorize all user names starting
with fte
apart from fteuser
, you
could add an additional agent-user
entry with a value
of fteuser
in the unauthorized
section.
This element would take precedence over the fte.*
regular
expression, because unauthorized
entries overrule authorized
entries
when they evaluate to the same value.
In the following example,
one of the agent-user
entries in the authorized
section
is the user name accounts1
. One of the agent-user
entries
in the unauthorized
section is the regular expression accounts*
,
this overrides the authorization given to the user name accounts1
.
All users that match the regular expression accounts*
,
including the user accounts1
, are not authorized
on this file space.