dfischer.femtowebserver.httpd
Class HttpUploadFile

java.lang.Object
  |
  +--dfischer.femtowebserver.httpd.HttpUploadFile

public class HttpUploadFile
extends java.lang.Object

Data encapsulation for uploaded files.
HTML example:

 <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD>
 <TABLE CELLSPACING=0 CELLPADDING=1 BORDER=0>
 <FORM ACTION="LoadDataWeblet" METHOD="POST" ENCTYPE="multipart/form-data">
 <INPUT TYPE=HIDDEN NAME="action" VALUE="load">
 <TR>
 <TD NOWRAP>File:&nbsp;</TD>
 <TD>&nbsp;&nbsp;</TD>
 <TD><INPUT TYPE=FILE SIZE=30 MAXLENGTH=2000000 NAME="uploadFile" accept="*/*"></TD>
 </TR>
 <TR><TD COLSPAN=3>&nbsp;</TD></TR>
 <TR><TD COLSPAN=3><INPUT TYPE=SUBMIT VALUE="Upload"></TD></TR>
 </FORM>
 </TABLE>
 </TD></TR></TABLE>
 

See Also:
HttpRequest.getUploadFile(java.lang.String), HttpRequest.getUploadFiles()

Method Summary
 java.lang.String getContentType()
          Returns the MIME (data-) type of the uploaded file content.
 byte[] getData()
          Returns the upladed file content (data).
 java.lang.String getParameterName()
          Returns the HTML parameter name of the uploaded file.
 java.lang.String getUploadFilename()
          Returns the real uploaded filename from client side (browser) with its full path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParameterName

public java.lang.String getParameterName()
Returns the HTML parameter name of the uploaded file. See also HTML example at class level: NAME="uploadFile".
Returns:
the HTML parameter name of the uploaded file
See Also:
HttpRequest.getUploadFile(java.lang.String)

getUploadFilename

public java.lang.String getUploadFilename()
Returns the real uploaded filename from client side (browser) with its full path. The path syntax depends on the operating system where the browser is running.
Returns:
uploaded filename from client side

getData

public byte[] getData()
Returns the upladed file content (data).
Returns:
upladed file content, or null if no file has been selected by the browser

getContentType

public java.lang.String getContentType()
Returns the MIME (data-) type of the uploaded file content. Example: "APPLICATION/OCTET-STREAM". The MIME type will be selected at client side (browser) and depends on the system configuration, the browser configuration and the operating system. However "APPLICATION/OCTET-STREAM" is a generic value for "binary data" and often used, if the browser is unable to determine the content type.
Returns:
MIME (data-) type of the uploaded file content, always in UPPERCASE. May be null if no content type has been set by the browser.