Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215

dojox/form/FileUploader.js

  • Provides:

    • dojox.form.FileUploader
  • Requires:

    • dojox.embed.Flash in common
    • dojo.io.iframe in common
    • dojox.html.styles in common
    • dijit._Widget in common
    • dijit._Templated in common
    • dojox.embed.flashVars in common
    • dijit._Contained in common
  • dojox.form.FileUploader

    • type
      Function
    • chains:
      • dijit._Widget: (prototype)
      • dijit._Templated.prototype: (prototype)
      • dijit._Contained.prototype: (prototype)
      • dijit._Widget: (call)
      • dijit._Templated: (call)
      • dijit._Contained: (call)
    • summary
      Handles File Uploading to a server (PHP script included for testing)
      
      FileUploader is now a WIDGET. You do not have to pass a button
      in. Passing a button is still supported until version 1.5 to maintain
      backwards compatibility, but it is not reccomended. Just create your
      uploader like any other widget.
    • description
      If the correct version of Flash Player is available (> 9.0) , a SWF
      is used. If Flash Player is not installed or is outdated, a typical
      html fileInput is used. This process can be overridden with
    • example
      fileMask = ["Images", "*.jpg;*.jpeg;*.gif;*.png"]
      or
      fileMask = [
      ["Jpeg File", 	"*.jpg;*.jpeg"],
      ["GIF File", 	"*.gif"],
      ["PNG File", 	"*.png"],
      ["All Images", 	"*.jpg;*.jpeg;*.gif;*.png"],
      ]
      NOTE: MacType is not supported, as it does not work very well.
      fileMask will work on a Mac, but differently than
      Windows.
  • dojox.form.FileUploader.swfPath

    • type
      Object
  • dojox.form.FileUploader.templateString

    • type
      String
  • dojox.form.FileUploader.uploadUrl

    • type
      String
    • summary
      The url targeted for upload. An absolute URL is preferred. Relative URLs are
      changed to absolute.
  • dojox.form.FileUploader.isDebug

    • type
      Boolean
    • summary
      If true, outputs traces from the SWF to console. What exactly gets passed
      is very relative, and depends upon what traces have been left in the DEFT SWF.
  • dojox.form.FileUploader.devMode

    • type
      Boolean.
    • summary
      Re-implemented. devMode increases the logging, adding style tracing from the SWF.
      
      
      
      id: String
      The object id, just like any other widget in Dojo. However, this id
      is also used as a reference for the SWF
      id: "",
  • dojox.form.FileUploader.baseClass

    • type
      String
    • summary
      The name of the class that will style the button in a "normal" state.
      If baseClass is not defined, 'class' will be used.
      NOTE: By default the uploader will be styled like a dijit buttons and
      adhere to the the themes. Tundra, Soria, and Nihilo are supported.
      You can cascade the existing style by using 'class' or 'style'. If you
      overwrite baseClass, you should overwrite the remaing state classes
      that follow) as well.
  • dojox.form.FileUploader.hoverClass

    • type
      String
    • summary
      The name of the class that will style the button in a "hover" state. A specific
      class should be made to do this. Do not rely on a target like button:hover{...}
  • dojox.form.FileUploader.activeClass

    • type
      String
    • summary
      The name of the class that will style the button in a "press" state. A specific
      class should be made to do this. Do not rely on a target like button:active{...}
  • dojox.form.FileUploader.disabledClass

    • type
      String
    • summary
      The name of the class that will style the button when its disabled.
  • dojox.form.FileUploader.force

    • type
      String
    • summary
      Use "flash" to always use Flash (and hopefully force the user to download the plugin
      if they don't have it). Use "html" to always use the HTML uploader. An empty string
      (default) will check for the right version of Flash and use HTML if not available.
  • dojox.form.FileUploader.uploaderType

    • tags: readonly
    • type
      String
    • summary
      Internal. What type of uploader is being used: "flash" or "html"
  • dojox.form.FileUploader.flashObject

    • tags: readonly
    • type
      dojox.embed.Flash
    • summary
      The object that creates the SWF embed object. Mostly Internal.
  • dojox.form.FileUploader.flashMovie

    • tags: readonly
    • type
      Function
    • summary
      The SWF. Mostly Internal.
  • dojox.form.FileUploader.insideNode

    • tags: readonly
    • type
      HTMLNode
    • summary
      The div that holds the SWF and form/fileInput
  • dojox.form.FileUploader.deferredUploading

    • type
      Number
    • summary
      (1 - X)
      (Flash only) throttles the upload to a certain amount of files at a time.
      By default, Flash uploads file one at a time to the server, but in parallel.
      Firefox will try to queue all files at once, leading to problems. Set this
      to the amount to upload in parallel at a time.
      Generally, 1 should work fine, but you can experiment with queuing more than
      one at a time.
      This is of course ignored if selectMultipleFiles equals false.
  • dojox.form.FileUploader.fileListId

    • type
      String
    • summary
      The id of a dom node to be used as a container for the pending file list.
  • dojox.form.FileUploader.uploadOnChange

    • type
      Boolean
    • summary
      If true, uploads imediately after a file has been selected. If false,
      waits for upload() to be called.
  • dojox.form.FileUploader.selectMultipleFiles

    • type
      Boolean
    • summary
      If true and flash mode, multiple files may be selected from the dialog.
      If html mode, files are not uploaded until upload() is called. The references
      to each file is incremented:uploadedfile0, uploadedfile1, uploadedfile2... etc.
  • dojox.form.FileUploader.htmlFieldName

    • type
      String
    • summary
      The name of the field of the fileInput that the server is expecting
  • dojox.form.FileUploader.flashFieldName

    • type
      String
    • summary
      The name of the field of the flash uploaded files that the server is expecting
  • dojox.form.FileUploader.fileMask

    • type
      Array[
    • summary
      Array[Description, FileTypes], Array[...]...]
      (an array, or an array of arrays)
      Restrict file selection to certain file types
      Empty array defaults to "All Files"
  • dojox.form.FileUploader.minFlashVersion

    • type
      Number
    • summary
      The minimum of version of Flash player to target. 0 would always install Flash, 100
      would never install it. The Flash Player has supported multiple uploads since
      version 8, so it could go as low as that safely.
  • dojox.form.FileUploader.tabIndex

    • type
      Number|String
    • summary
      The tab order in the DOM. Only supported by Flash. HTML Uploaders have security
      protection to prevent you from tabbing to the uploader. Stupid.
  • dojox.form.FileUploader.showProgress

    • type
      Boolean
    • summary
      If true, the button changes to a progress bar during upload.
  • dojox.form.FileUploader.progressMessage

    • type
      String
    • summary
      The message shown while the button is changed to a progress bar
  • dojox.form.FileUploader.progressBackgroundUrl

    • type
      String|Uri
    • summary
      The background image to use for the button-progress
  • dojox.form.FileUploader.progressBackgroundColor

    • type
      String|Number
    • summary
      The background color to use for the button-progress
  • dojox.form.FileUploader.progressWidgetId

    • type
      String
    • summary
      The widget id of a Dijit Progress bar. The Uploader will bind to it and update it
      automatically.
  • dojox.form.FileUploader.skipServerCheck

    • type
      Boolean
    • summary
      If true, will not verify that the server was sent the correct format.
      This can be safely set to true. The purpose of the server side check
      is mainly to show the dev if they've implemented the different returns
      correctly.
  • dojox.form.FileUploader.serverTimeout

    • type
      Number
    • summary
      (milliseconds)
      The amount of time given to the uploaded file
      to wait for a server response. After this amount
      of time, the onComplete is fired but with a 'server timeout'
      error in the returned item.
  • dojox.form.FileUploader.log

    • summary
      Due to the excessive logging necessary to make this code happen,
      It's easier to turn it on and off here in one place.
      Also helpful if there are multiple uploaders on one page.
    • type
      Function
  • dojox.form.FileUploader.constructor

    • constructor - constructor
    • type
      Function
  • dojox.form.FileUploader.postMixInProperties

    • type
      Function
  • dojox.form.FileUploader.fileList

    • type
      Array
  • dojox.form.FileUploader._cons

    • type
      Array
  • dojox.form.FileUploader.fileInputs

    • type
      Array
  • dojox.form.FileUploader.fileCount

    • type
      Number
  • dojox.form.FileUploader.flashReady

    • type
      bool
  • dojox.form.FileUploader._disabled

    • type
      bool
  • dojox.form.FileUploader._refNode

  • dojox.form.FileUploader.startup

    • type
      Function
  • dojox.form.FileUploader.postCreate

    • type
      Function
  • dojox.form.FileUploader.getHiddenWidget

    • summary
      Internal.
      If a parent widget has an onShow event, it is assumed
      that it is hidden and the parsing of the uploader is
      delayed until onShow fires. Note that the widget must
      fire onShow even if it is defaulted to showing/selected.
      this seems to work for Tabs (the primary fix).
    • type
      Function
  • dojox.form.FileUploader.getHiddenNode

    • parameters:
      • node: (typeof DomNode)
    • summary
      Internal.
      If a parent node is styled as display:none,
      returns that node. This node will be temporarilly
      changed to display:block. Note if the node is in
      a widget that has an onShow event, this is
      overridden.
    • type
      Function
  • dojox.form.FileUploader.getButtonStyle

    • summary
      Internal.
      Get necessary style information from srcRefNode and
      assigned styles
    • type
      Function
  • dojox.form.FileUploader.button

    • type
      Object
  • dojox.form.FileUploader._hiddenNode

    • type
      Object
  • dojox.form.FileUploader.srcNodeRef

  • dojox.form.FileUploader.pressClass

    • type
      String
  • dojox.form.FileUploader.norm

    • type
      Object
  • dojox.form.FileUploader.width

  • dojox.form.FileUploader.height

  • dojox.form.FileUploader.over

    • type
      Object
  • dojox.form.FileUploader.down

    • type
      Object
  • dojox.form.FileUploader.dsbl

    • type
      Object
  • dojox.form.FileUploader.fhtml

    • type
      Object
  • dojox.form.FileUploader.norm.lh

  • dojox.form.FileUploader.setButtonStyle

    • summary
      Internal.
      Set up internal dom nodes for button construction.
    • type
      Function
  • dojox.form.FileUploader.progTextNode.innerHTML

  • dojox.form.FileUploader.insideNode.innerHTML

  • dojox.form.FileUploader.onChange

    • parameters:
      • dataArray
    • summary
      stub to connect
      Fires when files are selected
      Event is an array of last files selected
    • type
      Function
  • dojox.form.FileUploader.onProgress

    • parameters:
      • dataArray
    • summary
      Stub to connect
      Fires as progress returns from SWF
      Event is an array of all files uploading
      Can be connected to for HTML uploader,
      but will not return anything.
    • type
      Function
  • dojox.form.FileUploader.onComplete

    • parameters:
      • dataArray
    • summary
      stub to connect
      Fires when all files have uploaded
      Event is an array of all files
    • type
      Function
  • dojox.form.FileUploader.onCancel

    • summary
      Stub to connect
      Fires when dialog box has been closed
      without a file selection
    • type
      Function
  • dojox.form.FileUploader.onError

    • parameters:
      • evtObject: (typeof Object)
        or String
    • summary
      Fires on errors
      
      FIXME: Unsure of a standard form for receiving errors
    • type
      Function
  • dojox.form.FileUploader.onReady

    • parameters:
      • uploader: (typeof dojox.form.FileUploader)
    • summary
      Stub - Fired when dojox.embed.Flash has created the
      Flash object, but it has not necessarilly finished
      downloading, and is ready to be communicated with.
    • type
      Function
  • dojox.form.FileUploader.onLoad

    • parameters:
      • uploader: (typeof dojox.form.FileUploader)
    • summary
      Stub - SWF has been downloaded 100%.
    • type
      Function
  • dojox.form.FileUploader.submit

    • parameters:
      • form: (typeof form)
        node ?
    • returns
      Boolean
    • summary
      If FileUploader is in a form, and other data should be sent
      along with the files, use this instead of form submit.
    • type
      Function
  • dojox.form.FileUploader.upload

    • parameters:
      • data: (typeof Object)
        postData to be sent to server
    • summary
      When called, begins file upload
    • type
      Function
  • dojox.form.FileUploader.restoreProgDisplay

    • type
      String
  • dojox.form.FileUploader.postData

  • dojox.form.FileUploader.removeFile

    • parameters:
      • name: (typeof String)
        The name of the file to be removed. Typically the file name,
        such as: picture01.png
      • noListEdit: (typeof Boolean)
        Internal. If true don't remove files from list.
    • summary
      Removes a file from the pending file list.
      Removes pending data from the Flash movie
      and fileInputes from the HTML uploader.
      If a file container node is bound, the file
      will also be removed.
    • type
      Function
  • dojox.form.FileUploader.destroy

    • summary
      Destroys uploader button
    • type
      Function
  • dojox.form.FileUploader._displayProgress

    • parameters:
      • display: (typeof Boolean)
        or Number
    • summary
      Shows and updates the built-in progress bar.
    • type
      Function
  • dojox.form.FileUploader._animateProgress

    • summary
      Internal. Animated the built-in progress bar
    • type
      Function
  • dojox.form.FileUploader._error

    • parameters:
      • evt
    • type
      Function
  • dojox.form.FileUploader._addToFileList

    • summary
      Internal only. If there is a file list, adds a file to it.
      If you need to use a function such as this, connect to
      onChange and update outside of this widget.
    • type
      Function
  • dojox.form.FileUploader._change

    • parameters:
      • dataArray
    • summary
      Internal. Updates uploader selection
    • type
      Function
  • dojox.form.FileUploader._complete

    • parameters:
      • dataArray
    • summary
      Internal. Handles tasks after files have finished uploading
    • type
      Function
  • dojox.form.FileUploader._progress

    • parameters:
      • dataObject
    • summary
      Internal. Calculate progress
    • type
      Function
  • dojox.form.FileUploader._getDisabledAttr

    • summary
      Internal. To get disabled use: widget.get("disabled");
    • type
      Function
  • dojox.form.FileUploader._setDisabledAttr

    • parameters:
      • disabled
    • summary
      Internal. To set disabled use: widget.set("disabled", true | false);
    • type
      Function
  • dojox.form.FileUploader._onFlashBlur

    • summary
      Internal. Detects when Flash movies reliquishes focus.
      We have to find all the tabIndexes in the doc and figure
      out whom to give focus to next.
    • type
      Function
  • dojox.form.FileUploader.nextFocusObject

  • dojox.form.FileUploader._disconnect

    • summary
      Internal. Disconnects fileInput in favor of new one.
    • type
      Function
  • dojox.form.FileUploader.uploadHTML

    • summary
      Internal. You could use this, but you should use upload() or submit();
      which can also handle the post data.
      
      NOTE on deferredUploading:
      This is not enabled for HTML. Workaround would be to force
      singleFile uploads.
      TODO:
      Investigate removing fileInputs and resending form
      multiple times adding each fileInput
    • type
      Function
  • dojox.form.FileUploader.createHtmlUploader

    • summary
      Internal. Fires of methods to build HTML Uploader.
    • type
      Function
  • dojox.form.FileUploader._connectInput

    • summary
      Internal. HTML Uploader connections. These get disconnected
      after upload or if multi upload.
    • type
      Function
  • dojox.form.FileUploader._checkHtmlCancel

    • parameters:
      • mouseType
    • summary
      Internal. Check if the dialog was opened and canceled without file selection.
    • type
      Function
  • dojox.form.FileUploader.dialogIsOpen

    • type
      bool
  • dojox.form.FileUploader._styleContent

    • summary
      Internal.Apply style to node
    • type
      Function
  • dojox.form.FileUploader.fhtml.nr

  • dojox.form.FileUploader._resetHTML

    • summary
      Internal. After upload, this is called to clear the form and build a new
      fileInput.
    • type
      Function
  • dojox.form.FileUploader._buildForm

    • summary
      Build the form that holds the fileInput
    • type
      Function
  • dojox.form.FileUploader._formNode

    • type
      Object
  • dojox.form.FileUploader._formNode.encoding

    • type
      String
  • dojox.form.FileUploader._formNode.id

    • type
      Object
  • dojox.form.FileUploader._buildFileInput

    • summary
      Build the fileInput field
    • type
      Function
  • dojox.form.FileUploader._fileInput.id

    • type
      String
  • dojox.form.FileUploader._fileInput

    • type
      Object
  • dojox.form.FileUploader.id

  • dojox.form.FileUploader._renumberInputs

    • type
      Function
  • dojox.form.FileUploader._setFormStyle

    • summary
      Apply a dynamic style to the form and input
    • type
      Function
  • dojox.form.FileUploader._setHtmlPostData

    • summary
      Internal.Apply postData to hidden fields in form
    • type
      Function
  • dojox.form.FileUploader.uploadFlash

    • summary
      Internal. You should use upload() or submit();
    • type
      Function
  • dojox.form.FileUploader.createFlashUploader

    • summary
      Internal. Creates Flash Uploader
    • type
      Function
  • dojox.form.FileUploader.fhtml.nr.w

  • dojox.form.FileUploader.fhtml.nr.h

  • dojox.form.FileUploader.flashObject.onError

    • type
      Object
  • dojox.form.FileUploader.flashObject.onReady

    • type
      Object
  • dojox.form.FileUploader.flashObject.onLoad

    • type
      Object
  • dojox.form.FileUploader._connectFlash

    • summary
      Subscribing to published topics coming from the
      Flash uploader.
    • description
      Sacrificing some readbilty for compactness. this.id
      will be on the beginning of the topic, so more than
      one uploader can be on a page and can have unique calls.
    • type
      Function
  • dojox.form.FileUploader._doSub

    • parameters:
      • subStr
      • funcStr
    • summary
      Internal. Shortcut for subscribes to Flash movie
    • type
      Function
  • dojox.form.FileUploader.urlencode

    • parameters:
      • url
    • type
      Function
  • dojox.form.FileUploader.isButton

    • parameters:
      • node
    • type
      Function
  • dojox.form.FileUploader.getTextStyle

    • parameters:
      • node
    • type
      Function
  • dojox.form.FileUploader.getText

    • parameters:
      • node
    • type
      Function
  • dojox.form.FileUploader.getStyle

    • parameters:
      • node
    • type
      Function
  • dojox.form.FileUploader.getTempNodeStyle

    • parameters:
      • node
      • _class
      • isDijitButton
    • type
      Function
  • dojox.form.FileUploader._subs

    • type
      Array
  • dojox.form

    • type
      Object
  • dojox

    • type
      Object