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.


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.


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[].


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).


When the request is processed, if you provide this binding, the mime type of the uploaded data will be set.


Returns true (during applyValues) if the size of the file uploaded exceeds the maximum allowed.


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.


Class FileUploadChooser

  extended by ariba.ui.aribaweb.util.AWBaseObject
      extended by ariba.ui.aribaweb.core.AWComponent
          extended by ariba.ui.widgets.FileUploadChooser
All Implemented Interfaces:
AWCycleable, AWCycleableReference, AWResponseGenerating, AWResponseGenerating.ResponseSubstitution, AWObject

public class FileUploadChooser
extends AWComponent

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
Constructor Summary
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.core.AWComponent
_topLevelApplyValues, _topLevelInvokeAction, _topLevelRenderResponse, allowEmbeddedKeyPaths, allowsWhitespaceCompression, application, applyValues, awcyclePageAndLog, bindingForName, bindingForName, bindings, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, browserMaxWidth, browserMinWidth, characterEncoding, clearValidationError, clientTimeZone, componentConfiguration, componentDefinition, componentPath, componentReference, createPageWithName, defaultTemplateParser, determineInstance, determineInstance, dict, dict, dict, doubleValueForBinding, doubleValueForBinding, doubleValueForBinding, encodedStringValueForBinding, encodedStringValueForBinding, ensureAwake, ensureFieldValuesClear, env, errorManager, escapeAttribute, escapeString, escapeUnsafeString, extendedFields, formValueManager, generateResponse, generateResponse, generateResponse, generateStringContents, getAWParameter, getDrivingBusinessObject, getFoldInSituOnWindowSizeParam, getPageRenderVersion, getThis, hasBinding, hasBinding, hasContentForTagName, hasContentNamed, hasMultipleTemplates, hasSubTemplateNamed, httpSession, init, init, initTemplateResourceManager, intValueForBinding, intValueForBinding, intValueForBinding, invokeAction, isBidirectional, isBrowserMicrosoft, isClientPanel, isMacintosh, isRenderAW5, isStateless, isStrictTagNaming, isUserCommunityEnabled, isValidationEnabled, languageDirection, languageLeft, languageRight, loadTemplate, localizedJavaString, markBacktrackState, name, namePath, notifyChange, otherBindings, otherBindingsValues, page, pageComponent, pageWithClass, pageWithClass, pageWithName, pageWithName, parent, postTakeValueActions, preferredLocale, recordBacktrackState, recordBacktrackState, recordValidationError, recordValidationError, recordValidationError, recordValidationErrors, recordValidationWarning, redirectToPage, registerRenderingListener, registerXmlNodeWithName, removeBacktrackState, renderResponse, replacementResponse, request, requestContext, requiresPreGlidCompatibility, resourceClassName, resourceManager, response, restoreFromBacktrackState, session, session, setCharacterEncoding, setClientPanel, setClientTimeZone, setComponentConfiguration, setDefaultTemplateParser, setEnv, setPerfDestinationInfo, setPreferredLocale, setResourceManager, setTemplateParser, setupForNextCycle, setValueForBinding, setValueForBinding, setValueForBinding, setValueForBinding, setValueForBinding, setValueForBinding, shouldCachePage, shouldCloseElements, strings, stringValueForBinding, stringValueForBinding, stringValueForBinding, supportedBindingNames, template, templateName, templateParser, templateResource, templateResourceManager, truncateBacktrackState, truncateBacktrackState, urlForResourceNamed, urlForResourceNamed, urlForResourceNamed, useXmlEscaping, valueForBinding, valueForBinding, valueForBinding, xml
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()

AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.