AttachmentUpload will upload file to an inputstream first and then store it into the database as BLOBs in the attachment table Note that this command is not registered in URLREG. AttachmentUploadCmd is not intended to be used directly, it should be extended by other commands. Note that if the uploaded file is a jar/zip we will not check if the jar or zip contains any files that have file extensions that are not supported.
To write your command which extend AttachmentUploadCmd, requires setting up attachment configuration section in the instance file.
<Attachment display="false" maxuploadsize="100000000"> <Command maxuploadsize="1000000" name="MyUploadCmd" supportedFileExtension="gif,jpg" uploadReturnURL_enabled="false" viruscheck="no" /> </Attachment>
Returns the attachement identifier to retrieve the attachment (attachment_id).
Field Summary | |
static java.lang.String | COPYRIGHT IBM copyright notice field |
static java.lang.String | defaultCommandClassName default class name |
Method Summary | |
java.lang.Long | getAttachmentId() Gets the id of the attachment object in database |
long | getAttachmentOwner() Gets the owner_id of the creator of the uploaded attachment. |
long | getFileSize() Gets the filesize if the uploaded file . |
void | setPersistDB(boolean flag) Sets if you want to persist the attachment stream in database table as BLOB The default will be to persist the attachment into database as BLOB |
Methods inherited from interface com.ibm.commerce.command.UploadToStreamCmd |
getAttachmentStream, getFileName, getUrl |
Methods inherited from interface com.ibm.commerce.command.ControllerCommand |
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRequestProperties, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.AccCommand |
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, performExecute, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters |
Methods inherited from interface com.ibm.commerce.security.Protectable |
fulfills, getOwner |
Field Detail |
public static final java.lang.String COPYRIGHT
public static final java.lang.String defaultCommandClassName
Method Detail |
public long getAttachmentOwner()
public long getFileSize()
public java.lang.Long getAttachmentId()
public void setPersistDB(boolean flag)
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.