public interface UploadToStreamCmd extends ControllerCommand
UploadToStreamCmd will upload the file to an InputStream. Note that this is not registered in URL configuration. UploadToStreamCmd is not intended to be used directly. It should be extended by other commands. It will return an InputStream. Any command that uses UploadToStreamCmd can convert the InputStream to whatever format is necessary.
This is not recommended for uploading a very large file, there may be performance issues.
If the uploaded file is a JAR or ZIP file the system will not verify whether the JAR or ZIP contains unsupported file types or extensions.
There is no access control management used with this command. If your command extends from UploadToStreamCmd, you should implement your own access control checking.
In addition, if your command extends from UploadToStreamCmd, it is required to set up the attachment configuration section in the instance file. For example:
<Attachment display="false" maxuploadsize="100000000"> <Command maxuploadsize="1000000" name="MyUploadCmd" supportedFileExtension="gif,jpg" uploadReturnURL_enabled="false" viruscheck="no" /> </Attachment>
This class returns the input stream used to upload the file (inputstream).
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.
|
Modifier and Type | Method and Description |
---|---|
long | getAttachmentOwner()
This method gets the owner_id of the creator of the uploaded attachment.
|
java.io.InputStream | getAttachmentStream()
This method gets the attachment stream from when the upload is completed.
|
java.lang.String | getFileName()
This method gets the filename of the uploaded file.
|
long | getFileSize()
This method gets the filesize of the uploaded file.
|
java.lang.String | getUrl()
This method gets the return URL when the upload is completed.
|
static final java.lang.String COPYRIGHT
static final java.lang.String defaultCommandClassName
java.lang.String getUrl()
java.io.InputStream getAttachmentStream()
long getAttachmentOwner()
long getFileSize()
java.lang.String getFileName()