Uploader API - v0.3
flashURL
The flashURL is the URL or URI of the swfupload.swf file.
settings
The settings object is an optional collection of name-value pairs that configure the Uploader:
Name | Description | Values | Default |
|---|---|---|---|
| maximum size for each file in bytes |
| "20480" |
| accepted file types |
| " |
| user-focused short description of which files are accepted |
| "image files" |
|
|
| 0 |
|
|
| 0 |
| selector, or HTML that is the replacement element for httpUploadElm. In the case of using the Uploader in a dialog this is probably an element that contains an Add Files link or button |
| "" |
| URL, URI, or function to load when the user clicks the Done button. If empty the button dismisses the dialog or reloads the page. |
| "" |
| URL, URI, or function to load when the user clicks the Cancel button. If empty the button dismisses the dialog or reloads the page. |
| "" |
| Function to call when the server reports a successful file upload. Passes two arguments, the client-side filename and the server response. This gives application-specific client code a way to coordinate with application-specific server code, so that, for example, a set of newly uploaded resource IDs can be passed to another page, or thumbnails of newly uploaded files can be displayed in another panel. |
| function(fileName, serverResponse) {} |
| usually set by the application to identify the current context for the upload |
| null |
| empty selector of the HTML element to replace on the page with the File Upload UI |
| "" |
| automatically display a new URL or close the dialog when the upload is complete |
| true |
|
| milliseconds | 2000 |
| maximum height in pixels for the file queue before scrolling |
| 190 |
| display the upload in a DHTML dialog |
| false |
| indicates whether or not to automatically open the native Browse window |
| false |
| selector for the 'Add Files' button |
| ".fluid-add-files-btn" |
| Javascript object containing selectors for various fragments of the uploader markup | see "Selectors" below |
var defaultSelectors = {
upload: ".fluid-uploader-upload",
resume: ".fluid-uploader-resume",
pause: ".fluid-uploader-pause",
done: ".fluid-uploader-done",
cancel: ".fluid-uploader-cancel",
browse: ".fluid-uploader-browse",
fileQueue: ".fluid-uploader-queue",
scrollingElement: ".fluid-scoller",
emptyRow : ".fluid-uploader-row-placeholder",
txtTotalFiles: ".fluid-uploader-totalFiles",
txtTotalBytes: ".fluid-uploader-totalBytes",
osModifierKey: ".fluid-uploader-modifierKey",
txtFileStatus: ".removeFile",
progress : ".fluid-progress",
qRowTemplate: "#queue-row-tmplt",
qRowFileName: ".fileName",
qRowFileSize: ".fileSize",
qRowRemove: ".fileRemove",
};
|
| provides verbose debugging output both in the browser and to the console |
| false |
Selectors
Name | Description | Default |
|---|---|---|
| selector of the DOM element that triggers the upload action | ".fluid-uploader-upload" |
|
| ".fluid-uploader-result" |
| selector of the DOM element that triggers the pause action | ".fluid-uploader-pause" |
| selector of the DOM element that triggers the browse files action | ".fluid-uploader-browse" |
| selector of the DOM element that triggers the done action | ".fluid-uploader-done" |
| selector of the DOM element that triggers the cancel action | ".fluid-uploader-cancel" |
|
| ".fluid-uploader-queue" |
|
| ".fluid-scroller" |
|
| ".fluid-uploader-row-placeholder" |
|
| ".fluid-uploader-totalFiles" |
|
| ".fluid-uploader-totalBytes" |
|
| ".fluid-uploader-modifierKey" |
|
| ".removeFile" |
|
| ".fluid-progress" |
|
| "#queue-row-tmplt" |
|
| ".fileName" |
|
| ".fileSize" |
|
| ".fileRemove" |