com.ibm.commerce.command

Interface TempUploadCmd

  • All Superinterfaces:
    AccCommand, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, ControllerCommand, ECCommand, Protectable, java.io.Serializable, com.ibm.websphere.command.TargetableCommand
    All Known Subinterfaces:
    WebAssetsUploadCmd
    All Known Implementing Classes:
    TempUploadCmdImpl, WebAssetsUploadCmdImpl


    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.

    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        IBM copyright notice field
        See Also:
        Constant Field Values
      • defaultCommandClassName

        static final java.lang.String defaultCommandClassName
        This is the default class name
        See Also:
        Constant Field Values
    • Method Detail

      • getUrl

        java.lang.String getUrl()
        This method gets the return URL of the command. When the command is completed, it will do a redirect to this URL.
        Returns:
        This method returns the URL.
      • getAttachmentURL

        java.lang.String getAttachmentURL()
        This method gets the attachment URL where the attachment is uploaded.
        Returns:
        This method returns the attachment URL, which is the unique URL of the uploaded attachment.
      • getAttachmentOwner

        long getAttachmentOwner()
        This method gets the owner ID of the uploaded attachment.
        Returns:
        This method returns the owner ID. This is the owner identifier of the uploaded attachment.
      • getFileSize

        long getFileSize()
        This method gets the file size of the uploaded attachment.
        Returns:
        This method returns the file size of the uploaded attachment.
      • getFileName

        java.lang.String getFileName()
        This method gets the file name of the uploaded attachment.
        Returns:
        This method returns the file name of the uploaded attachment.