Class Banana.Controls.ChunkUpload
Extends
Banana.Controls.Panel.
- Methods borrowed from class Banana.Controls.Panel:
- getTagName
- Methods borrowed from class Banana.UiControl:
- addControl, addCss, addCssClass, getAttribute, getAttributes, getClientId, getCss, getCssClass, getDimensions, getHtml, getHtmlAttributes, getState, getStyle, getStyleProperty, hasCssClass, registerEvents, removeAttribute, removeCssClass, removeState, setAttribute, setClientId, setCss, setEnabled, setState, setStyle, setVisible, switchCssClass, triggerEvent, unregisterEvents
- Methods borrowed from class Banana.Control:
- applyToChildren, bind, clear, createComponents, findControl, generateUniqueId, getControls, getDomEventTypes, getFirstUiControl, getId, getPage, getParent, getProxy, hasBind, invalidateDisplay, onPreInvalidateContents, onWindowResize, remove, render, setId, setPage, setParent, unbind, unload, updateDisplay
Defined in: ChunkedUpload.js.
creates a chunked upload control currently only supported by limited amount of browsers: chrome and firefox. uploads file is small chunks. the upload control ensures that chunks are send to the server in the correct order. Server is responsible to reconstruct the chunks to one file during file upload the first time a chunk is uploaded we append "firstChunk" to the post params last time a chunk is uploaded we append "lastChunk" to the post params. a "uid" param is appended to identify the file serverside
get a more readable string by given string of bytes
- Parameters:
- {String} bytes
- Returns:
- {String}
Check whether our upload control is supported by the browser
- Returns:
- {boolean}
Processes a chunk from a file this method is recalled everytime a chunk is completed. it stops when all chunks are completed
- Parameters:
- {Object} file
- {int} index
- part of the file chunk
- {function} cb
- called after each upload chunk completion
Here we listen to the fileupload event. we create a construction here to use maxSimultaneousUpload and ensure completion of all files
set the size of a chunk. the lower you set the chunk, the lower memory usuage will be, but also
- Parameters:
- {int} chunkSize
- Returns:
- {this}
max upload at the same time
- Parameters:
- {int} maxSimultaneousUpload
- Returns:
- {this}
- Parameters:
- {boolean} bool
- when true filedialog supports multiple file selection
- Returns:
- {this}