Documentation for a historical release of Infusion: 1.3
Please view the Infusion Documentation site for the latest documentation.
If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Fluid File Uploader Specification

Background

  • Currently most applications use the standard http file browse and upload service provided with the <input type="file"> form field.
    • Issues:
      • Only one file can be selected at a time foruploaded.
      • Interface is very different from browser to browser even down to the labels on the button.
      • The application can not specify the file type or types that are accepted by the current application context.
      • The browser does not provide consistent or, in some cases, meaningful feedback on the upload process.
  • A number of applications are getting around the standard browse and upload solution using Flash or Java in the browser, or creating stand-alone desktop interfaces to handle file uploading. Some of these solutions work very well but do not feel integrated in with the application context, and they are difficult if not impossible for the developers to modify.

Overview of Fluid File Uploader

  • The Fluid File Uploader uses different approuch to using Flash to improve the user experience of file uploading.
  • The Fluid File Uploader uses a small Flash file to call a standard OS file open dialog to allow the user to select multiple files, and uses Flash to talk to manage the interaction with the server for file upload.
  • This technique popularized by the YUI library and Flickr allows the the user interface is done completely in HTML with Javascript talking to the SWF (Flash) object, giving the application developer much more control over the user experience and a way to get around all of the basic problems of the standard http file upload.
  • Features
    • The user can select multiple files for upload using a single OS-specific file open dialog.
    • The application can specify which file types are accepted.
      • The uploader does not validate that the file actually matches the file type, that msut be done on the back end.
    • The Uploader allows the user to queue files, and start, pause, and resume the upload.
    • The Uploader provides complete progress information back to the user.
    • The user interface is completely customizable in HTML. With the exception being the OS specific file open dialog.
  • Know issues:
    • Application developers and system integrators must be careful to manage security.
    • Becuase a standard OS file open dialog is called, the all application specific feedback for the user can only given to the user before or after file browsing.

Files:

  • MultiFileUpload.js
  • MultiFileUpload.css
  • swfupload.js (version 2.1.0 beta 2)
  • swfupload_f9.swf (version 2.1.0 beta 2)

Required Dependencies

  • Fluid framework
  • jQuery 1.2.3

Optional Dependencies

  • To provide accessibility
    • Fluid jQuery accessibility plug-ins
  • To present the Uploader in a DHTML pop-up dialog
    • jQuery UI library.

Functionality

  • If a http_upload_elm is provided, initialization will replace the element with either the MFU_control_elm or with the MFU_container element. If no http_upload_elm is provided then it is assumed that the File Upload html is already displayed or

Methods

  • init( settings ) - initializes an uploader: adds event handlers to the various buttons, sets up the SWFUploader object, returns the instance of the uploader. Most settings should be edited in the actual definition of the uploader.

Required Settings [no defaults]

  • upload_url :: the URL or URI of the server-side handler for the file upload
  • flash_url :: the URL or URI of the swfupload.js file

Optional Settings

  • file_size_limit :: maximum size for each file in bytes. ["20480"]

  • file_types :: accepted file types ["." // any file ]

  • file_types_text :: user-focused short description of which files are accepted ["any file"]

  • file_upload_limit : [0]

  • file_queue_limit : [0]

  • elm_MFU_container :: selector of the container for the Multi-File Uploader [#MFUpload]

  • elm_MFU_control :: selector, or HTML that is the replacement element for http_upload_elm. In the case of using the MFU in a dialog this is probably a element that contains an Add Files link or button. [default: null]

  • elm_upload :: selector of the DOM element that triggers the upload action [.MFU_UploadBtn]

  • elm_pause :: selector of the DOM element that triggers the pause action [.MFU_PauseBtn]

  • elm_browse :: selector of the DOM element that triggers the browse files action [.MFU_BrowseBtn]

  • elm_done :: selector of the DOM element that triggers the done action [.MFU_DoneBtn]

  • elm_cancel :: selector of the DOM element that triggers the cancel action [.MFU_CancelBtn]

  • when_done :: URL, URI, or function to load when the user is clicks the Done button. If empty the button dismisses the dialog or reloads the page. [null]

  • when_cancel :: URL, URI, or function to load when the user click the Cancel button. If empty the button dismisses the dialog or reloads the page. [null]

  • post_params :: usually set by the application to identify the current context for the upload [null]

  • http_upload_elm - [empty] selector of the HTML element to replace on the page with the File Upload UI [null]

  • continue_after_upload - [false] - automatically display a new URL or close the dialog when the upload is complete

  • dialog_display - [false] - display the upload

  • debug :: provides verbose debugging output both in the browser and to the console [false]

  • No labels