Adempiere 3.5.2a

org.compiere.util
Class FileUpload

java.lang.Object
  extended by 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

Field Summary
protected  CLogger log
          Logger
 
Constructor Summary
FileUpload(HttpServletRequest request)
          Upload File from requesr
 
Method Summary
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 Int
 String toString()
          String Representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected CLogger log
Logger

Constructor Detail

FileUpload

public FileUpload(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

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.