<a:FileUpload>

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)

ariba.ui.aribaweb.html
Class AWFileUpload

java.lang.Object
  extended by ariba.ui.aribaweb.util.AWBaseObject
      extended by ariba.ui.aribaweb.core.AWComponent
          extended by ariba.ui.aribaweb.html.AWFileUpload
All Implemented Interfaces:
AWCycleable, AWCycleableReference, AWResponseGenerating, AWResponseGenerating.ResponseSubstitution, AWObject

public final class AWFileUpload
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
AWResponseGenerating.ResponseSubstitution
 
Constructor Summary
AWFileUpload()
           
 
Method Summary
 boolean hasMaxLength()
           
 java.lang.String[] supportedBindingNames()
           
 
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, 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
 

Constructor Detail

AWFileUpload

public AWFileUpload()
Method Detail

supportedBindingNames

public java.lang.String[] supportedBindingNames()
Overrides:
supportedBindingNames in class AWComponent

hasMaxLength

public boolean hasMaxLength()


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