Index

Classes

Class

Methods

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.

Class Detail
Banana.Controls.ChunkUpload()

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

Method Detail
{Object} getFile(filename)
Parameters:
{String} filename
Returns:
{Object}
{String} getReadablizeBytes(bytes)

get a more readable string by given string of bytes

Parameters:
{String} bytes
Returns:
{String}
handleFilesSelected(files)

Handle file selected

Parameters:
{Array} files
{boolean} isSupported()

Check whether our upload control is supported by the browser

Returns:
{boolean}
processFileChunkFrom(file, index, cb)

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
registerCustomEvents()

Here we listen to the fileupload event. we create a construction here to use maxSimultaneousUpload and ensure completion of all files

{this} setChunkSize(chunkSize)

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}
{this} setMaxSimultaneousUpload(maxSimultaneousUpload)

max upload at the same time

Parameters:
{int} maxSimultaneousUpload
Returns:
{this}
{this} setMultipleFilesUpload(bool)
Parameters:
{boolean} bool
when true filedialog supports multiple file selection
Returns:
{this}
{this} setPostUrl(url)

sets the url to post to

Parameters:
{String} url
Returns:
{this}
uploadChunk(chunk, file, cb)

Uploads a chunk if a chunk fails we set uploadError on file object to true

Parameters:
{Object} chunk
{Object} file
cb
fired after successfully uploading chunk
uploadFiles(of, from, to)

Executes the upload procedure

Parameters:
{Array} of
files
{int} from
{to} to

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 05 2012 22:01:31 GMT+0100 (CET)