|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
AWFileUpload wraps the standard html input element for uploading the contents of a file from the client machine.
By default, the entire contents of a file upload are read into memory while parsing the request. However, if your application expects to upload large amounts of data at any time, you can put the application into a mode whereby it will use a temporary file on disk to store the contents of file uploads. To enter this mode, simply call ariba.ui.aribaweb.util.AWMimeReader.setFileUploadDirectory(...) and pass in the name of a scratch directory that can be used for temporary files. Note that any temporary files will be deleted at the end of each request when the request is "disposed", therefore you must always read the entire contents of any temporary files during the current request, or rename the File object to avoid its being deleted.
Bindings | |||
---|---|---|---|
inputStream
|
If this binding is provided, the contents of the uploaded data will be made available to the application in the form of an InputStream, which can be read by the application. You may use one of three bindings (inputStream, bytes, file) but not more than one. Note that, if a temporary file directory has been specified, you must read the entire contents of this inputStream before the end of this request as the file behind this input stream will be deleted. |
java.io.InputStream (set) |
|
bytes
|
If this binding is provided, the contents of the uploaded data will be made available to the application in the form of a byte[]. If the application is in the mode which requires it to write all incoming file uploads to disk, this will simply read the contents from disk int a byte[]. |
byte[] (set) |
|
file
|
If you have setup a temporary file directory, you may specify the "file" binding and be passed a java.io.File object. You must either rename the file (to avoid its being deleted at the end of the request) or read its contents into memory. Of course, if you were going to read the contents, you might as well use the inputStream or bytes options as they will make that easier for you. |
java.io.File (set) |
|
filename
|
The name of the user's file (from the client machine). |
String (set) |
|
mimeType
|
When the request is processed, if you provide this binding, the mime type of the uploaded data will be set. |
String (set) |
|
fileSizeExceeded
|
Returns true (during applyValues) if the size of the file uploaded exceeds the maximum allowed. |
boolean (set) |
|
name
|
The name of the form input element. It is not recommended that you use this field as the aribaweb framework prefers to automatically assign names to html elements. |
String (get) |
|
newMode
|
The temporary binding to determine the if values are pushed for empty file. In old mode (newMode equals false), null values can mean one of the following: 1) Bad file name 2) Good file name, but empty file 3) Blank (0 or more white spaces) file name In new mode, values are never null. If file is empty and filename is empty, that means 3). If file is empty and filename is not empty, that means either 1) or 2). |
boolean (get) |
|
maxLength
|
Override the maximum length. This binding can be used whether or not there is a static max length currently set so the maxlength can be used to a) ensure that at a certain file upload has does not exceed a certain length while allowing all standard file uploads to be unlimited in length b) (more common) allow a particular file upload control to specify a max length which is greater than the global (system wide) max length If there are multiple AWFileUpload controls on a page, the max length for each AWFileUpload can be set independently. Any AWFileUpload without this binding will have a maxlength based on the global setting for the system. |
int (get) |
|
encrypt
|
Request to not store the content unencrypted on disk. This option cannot be used with the file bindig. This option can only be selected if the AWApplication provides an encryption provider. |
boolean (get) |
|
disabled
|
Makes the File upload control unclickable and greys out its appearance. |
boolean (get) |
java.lang.Objectariba.ui.aribaweb.util.AWBaseObject
ariba.ui.aribaweb.core.AWComponent
ariba.ui.aribaweb.html.AWFileUploadInternals
public final class AWFileUploadInternals
Because applyValues is overridden and super.applyValues is NOT called, the template for this component should not contain ANY elements which consume element id's. The element id stack is maintained by the template in render phase and the overridden applyValues method in the apply phase.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ariba.ui.aribaweb.core.AWComponent |
---|
AWComponent.RenderingFilter, AWComponent.RenderingListener |
Nested classes/interfaces inherited from interface ariba.ui.aribaweb.core.AWResponseGenerating |
---|
AWResponseGenerating.ResponseSubstitution |
Constructor Summary | |
---|---|
AWFileUploadInternals()
|
Method Summary | |
---|---|
void |
applyValues(AWRequestContext requestContext,
AWComponent component)
The receiver should take any form values (or query string parameters) that it owns from the AWRequestContext.request() . |
java.lang.Object |
disabled()
|
java.lang.String |
fileUploadName()
|
boolean |
hasMaxLength()
|
boolean |
inPlaybackMode()
|
void |
renderResponse(AWRequestContext requestContext,
AWComponent component)
The receiver should render its content to the AWRequestContext.response() |
java.lang.String[] |
supportedBindingNames()
|
java.lang.String |
urlInputName()
|
Methods inherited from class ariba.ui.aribaweb.util.AWBaseObject |
---|
debugString, getFieldValue, isKindOfClass, localizedJavaString, logString, logWarning, setFieldValue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ariba.ui.aribaweb.util.AWObject |
---|
getFieldValue, isKindOfClass, setFieldValue |
Field Detail |
---|
public AWEncodedString _elementId
public java.lang.String _fileUploadName
Constructor Detail |
---|
public AWFileUploadInternals()
Method Detail |
---|
public java.lang.String[] supportedBindingNames()
supportedBindingNames
in class AWComponent
public boolean hasMaxLength()
public java.lang.String fileUploadName()
public java.lang.Object disabled()
public void renderResponse(AWRequestContext requestContext, AWComponent component)
AWCycleable
AWRequestContext.response()
renderResponse
in interface AWCycleable
renderResponse
in class AWComponent
requestContext
- the context for the current request.component
- the current parent componentpublic void applyValues(AWRequestContext requestContext, AWComponent component)
AWCycleable
AWRequestContext.request()
.
applyValues
in interface AWCycleable
applyValues
in class AWComponent
requestContext
- the context for the current request.component
- the current parent componentpublic boolean inPlaybackMode()
public java.lang.String urlInputName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |