Class FileUpload


  • public class FileUpload
    extends Object
    Web File Upload utility. Based on code like:
    Version:
    $Id: FileUpload.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
    Author:
    Jorg Janke
    • Field Detail

      • log

        protected CLogger log
        Logger
    • Constructor Detail

      • FileUpload

        public FileUpload​(javax.servlet.http.HttpServletRequest request)
        Upload File from requesr
        Parameters:
        request - request
    • Method Detail

      • createForm

        public static org.apache.ecs.xhtml.form createForm​(String action)
        Create Upload Form. You need to add the (hidden) parameter
        Parameters:
        action - form action
        Returns:
        form
      • getData

        public byte[] getData()
        Returns:
        Returns the data.
      • getFileName

        public String getFileName()
        Returns:
        Returns the actual fileName (without path).
      • getError

        public String getError()
        Returns:
        Returns the error message or null.
      • getParameter

        public String getParameter​(String parameterName)
        Get MultiPart Form Parameter. Assumes single line (no cr) Request -----------------------------7d433475038e Content-Disposition: form-data; name="R_Request_ID" 1000000 -----------------------------7d433475038e--
        Parameters:
        parameterName - name of parameter
        Returns:
        parameter or null of mot found
      • getParameterAsInt

        public int getParameterAsInt​(String parameterName)
        Get Multi Part Parameter As Int
        Parameters:
        parameterName - name
        Returns:
        result or 0
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class Object
        Returns:
        info