|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
FileUploadChooser wraps AWFileUpload, providing better behavior post upload. In particular with a standard upload control, after an upload, if the user is on the same form (validation error, etc) then the upload control is cleared. With FileUploadChooser, post upload the uploaded file name is displayed read-only (but with a Clear button) so that subsequent form posts will not clear the file.
In addition, FileUploadChooser keeps the uploaded file around (in /tmp) until the app deletes it or the server process exits (unlike AWFileUpload which will delete it upon end of request).
Note that the app must initialize ariba.ui.aribaweb.util.AWMimeReader.setFileUploadDirectory(...) so that file writing to disk is enabled.
Bindings | |||
---|---|---|---|
file
|
This file will be stored in a subdirectory of AWMimeReader.fileUploadDirectory() and its name will match the user's original file name. This file is set with File.deleteOnExit(), so the app must move it if the file contents are to be retained. |
java.io.File (both) |
|
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) |
|
filename
|
The name of the file. On upload, the name from the user's machine is pushed. The binding is also pulled to get the label to be displayed post upload. (If not bound, the name() of the pull of the file binding will be used). |
String (both) |
|
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) |
|
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) |
java.lang.Objectariba.ui.aribaweb.util.AWBaseObject
ariba.ui.aribaweb.core.AWComponent
ariba.ui.widgets.FileUploadChooser
public class FileUploadChooser
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 | |
---|---|
FileUploadChooser()
|
Method Summary | |
---|---|
void |
clear()
|
boolean |
hasContent()
|
void |
setFile(java.io.File file)
|
void |
setFilename(java.lang.String filename)
|
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 java.lang.String _displayName
Constructor Detail |
---|
public FileUploadChooser()
Method Detail |
---|
public void clear()
public void setFilename(java.lang.String filename)
public void setFile(java.io.File file)
public boolean hasContent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |