Core Docs | Additional Modules Docs

sb.upload


@Description: Instantiates a new upload
@File: upload.js
@Example:
var uploader = new sb.upload({
    debug : true,
    maxFiles : 5,
    maxFileSizeK : 5000000,
    url : 'http://framework.sv/post',
    data : {
        friend : 'tim',
        nano : "Hello there timmy's dog"
    },
    onReturnData : function(file){},
    onExceedsMaxFiles : function(){},
    onExceedsMaxFileSizeK : function(file){},
    onError : function(data){
        alert(data.message);
    }
});

uploader.browse();

sb.upload.cancel


@Description: Cancels any upload currently in process in any sb.upload instance
@File: upload.js

sb.upload.prototype.acceptedFileTypes


@Description: The accepted file types/names as a string e.g. '*.jpg;*.png;'
@File: upload.js

sb.upload.prototype.browse


@Description: Starts the file upload by prompting the user with a file browse box
@File: upload.js

sb.upload.prototype.data


@Description: Additional data objectw hich is url encoded into post data and sent with the files
@File: upload.js

sb.upload.prototype.debug


@Description: Determines if file upload debug info is traced to the flash debug player
@File: upload.js

sb.upload.prototype.maxFileSizeK


@Description: The maximum file size per file that the user can upload before it throws an error and fires onMaxFileSizeExceeded
@File: upload.js

sb.upload.prototype.maxFiles


@Description: The maximum number of files the user can select in the browser before it throws an error and fires onMaxFilesExceeded
@File: upload.js

sb.upload.prototype.onAllComplete


@Description: Fires when all uploads for this upload instance are complete
@File: upload.js
@Param: object files.total

sb.upload.prototype.onAllProgress


@Description: Fires each time one more file is uploaded until the que is empty
@File: upload.js
@Param: object files.total, files.remaining

sb.upload.prototype.onCancelAll


@Description: Fires once when the upload que is canceled using upload.cancel();
@File: upload.js

sb.upload.prototype.onCancelBrowse


@Description: Fires when the user hits cancel in the file browser
@File: upload.js

sb.upload.prototype.onCancelFile


@Description: Fires when one file in the que is canceled by filename with upload.cancel(file.name); or once per file when upload.cancel()l is fired without a name specified
@File: upload.js
@Param: object file.name

sb.upload.prototype.onComplete


@Description: Fires when a file is done uploading, must beturn something from the serer for this to fire, can be a simple space
@File: upload.js
@Param: object file.name, file.size, file.sizeK, file.type

sb.upload.prototype.onError


@Description: Fires if the upload is canceled due to an error
@File: upload.js
@Param: object file.name, file.size, file.sizeK, file.type, file.error

sb.upload.prototype.onExceedsMaxFileSizeK


@Description: Fires when a file exceeds the maximum file size specified and is therefore not uplaoded
@File: upload.js
@Param: object file file.name, file.size, file.sizeK, file.exceededBy, file.limit, file.message

sb.upload.prototype.onExceedsMaxFiles


@Description: Fires when a user selects too many files
@File: upload.js
@Param: object files.chosen, files.limit, files.message

sb.upload.prototype.onOpen


@Description: Fires when the file is opened for upload on the client's computer
@File: upload.js
@Param: object file.name, file.size, file.sizeK, file.type

sb.upload.prototype.onProgress


@Description: Fires periodically as a file uploads alerting you of the progress in percent, deosn't seem to fire for really quick uploads on local server, must return something from the serer for this to fire, can be a simple space
@File: upload.js
@Param: object file.name, file.size, file.sizeK, file.type, file.bytesLoaded, file.bytesTotal, file.percent

sb.upload.prototype.onReturnData


@Description: Fires when the data is returned from the server, , must beturn something from the serer for this to fire, can be a simple space
@File: upload.js
@Param: object file.name, file.size, file.sizeK, file.type, file.data

sb.upload.prototype.onSelect


@Description: Fires when the user selects files from the browse box that pops up when you begin an upload
@File: upload.js
@Param: object files.total

sb.upload.prototype.url


@Description: The URL to upload the data to
@File: upload.js

string name optionally cancels only for files that match the file name given


@Description: Cancels all file uploads for this instance
@File: upload.js