public interface AttachmentUploadCmd extends UploadToStreamCmd
This class will upload a file to an input stream and then store it in the database as BLOBs in the attachment table. Note that this command is not registered in the URL configuration. AttachmentUploadCmd is not intended to be used directly. It should be extended by other commands. If the uploaded file is a JAR or ZIP file, the system will not verify whether the JAR or ZIP file contains unsupported file types or file name extensions.
Writing a command that extends AttachmentUploadCmd requires setting up the 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>This class returns the attachment identifier to retrieve the attachment (attachment_id).
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 |
---|---|
java.lang.Long | getAttachmentId()
This method gets the id of the attachment object in database.
|
long | getAttachmentOwner()
This method gets the owner id of the creator of the uploaded attachment.
|
long | getFileSize()
This method gets the file size of the uploaded file .
|
void | setPersistDB(boolean flag)
This method sets whether the attachment stream should be persisted in the database table as BLOB.
|
static final java.lang.String COPYRIGHT
static final java.lang.String defaultCommandClassName
long getAttachmentOwner()
long getFileSize()
java.lang.Long getAttachmentId()
void setPersistDB(boolean flag)