Package org.compiere.util
Class FileUpload
- java.lang.Object
-
- org.compiere.util.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
-
-
Constructor Summary
Constructors Constructor Description FileUpload(javax.servlet.http.HttpServletRequest request)
Upload File from requesr
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.apache.ecs.xhtml.form
createForm(String action)
Create Upload Form.byte[]
getData()
String
getError()
String
getFileName()
String
getParameter(String parameterName)
Get MultiPart Form Parameter.int
getParameterAsInt(String parameterName)
Get Multi Part Parameter As IntString
toString()
String Representation
-
-
-
Field Detail
-
log
protected CLogger log
Logger
-
-
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
-
-