public interface TempUploadCmd extends ControllerCommand
This class will upload a file to a file system with a unique generated filename.
Note that this is not registered in the URL
configuration or the command
configuration. This class is not intended to be used directly. It should be extended by other commands.
There is no access control management. If your command extends TempUploadCmd
,
you should implement your own access control checking.
The filepath
to be uploaded is $wcsstore\storename\filepath
. $wcsstore
is defined in instance configuration file. storename
is based on the store_id
retrieved from the command context, that is, the store that you logon to. filepath
is user input.
To write a command that extends TempUploadCmd
, the attachment configuration section in the
instance file must be set up. For example:
<Attachment display="false"
maxuploadsize="100000000">
<Command maxuploadsize="1000000"
name="MyUploadCmd"
supportedFileExtension="gif,jpg"
uploadReturnURL_enabled="false"
viruscheck="no" />
</Attachment>
name="MyUploadCmd"
: The command name that extends TempUploadCmd
. This must be the
command name that is retrieved from the command context.maxuploadsize
: The maximum allowable upload size for MyUploadCmd
. This must be
less than the site maxuploadsize
.supportedFileExtension
: The file extension that is allowed to be uploaded.uploadReturnURL_enabled
: Whether to return to the URL
when the command is
completed.virusCheck
: Indicates whether virusCheck
should be enabled. Virus checking is
not provided by default.The result of the command is a URL
which can be called to retrieve the attachment, that is,
the attachmenturl
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field
|
static java.lang.String |
defaultCommandClassName
This is the default class name
|
Modifier and Type | Method and Description |
---|---|
long |
getAttachmentOwner()
This method gets the owner ID of the uploaded attachment.
|
java.lang.String |
getAttachmentURL()
This method gets the attachment
URL where the attachment is uploaded. |
java.lang.String |
getFileName()
This method gets the file name of the uploaded attachment.
|
long |
getFileSize()
This method gets the file size of the uploaded attachment.
|
java.lang.String |
getUrl()
This method gets the return
URL of the command. |
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, performExecute, setCommandTarget, setCommandTargetName, setOutputProperties
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, performExecute, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
fulfills, getOwner
static final java.lang.String COPYRIGHT
static final java.lang.String defaultCommandClassName
java.lang.String getUrl()
URL
of the command.
When the command is completed, it will do a redirect to this URL
.URL
.java.lang.String getAttachmentURL()
URL
where the attachment is uploaded.URL
, which is the unique URL
of the uploaded attachment.long getAttachmentOwner()
long getFileSize()
java.lang.String getFileName()