jQuery.fn.glowUpload
Renders a single file upload form supporting chunked uploads with a visual progress bar
Usage
$('SELECTOR').glowUpload(options)
where 'SELECTOR' is a div element containing file input
Options
-
fileFilter
: Array of filters to apply when selecting files. Each filter is an object with format{title : "Zip files", extensions : "zip"}
- default: null
-
maxFileSize
: Maximum file size of a selectable file- default: '51200kb'
-
width
: Width of control- default: '350px'
-
uploadUrl
: URL to upload against. With Studio Widgets, this is the result of a call to create a context ID and build an upload URL for it:$core_v2_uploadedFile.GetUploadUrl($core_v2_uploadedFile.CreateContextId())
- default: '/'
-
swfUrl
: Path to SWF upload component- default: $.telligent.evolution.site.getBaseUrl() + 'utility/images/glow/plupload.flash.swf'
-
xapUrl
: Path to Silverlight upload component- default: $.telligent.evolution.site.getBaseUrl() + 'utility/images/glow/plupload.silverlight.swf'
-
uploadedFormat
: HTML template to use for an uploaded item- default: '<div style="overflow: hidden; text-overflow: ellipsis; word-break: break-all; white-space: normal; color: #000; padding: .25em;"><div style="float: right; color: #3a3; margin-left: .25em;">Uploaded</div>{0}</div>'
-
uploadingFormat
: HTML template to use for an uploading item- default: '<div style="overflow: hidden; text-overflow: ellipsis; word-break: break-all; white-space: normal; color: #000; padding: .25em;"><div style="float: right; margin-top: .25em; margin-left: .25em; border: solid 1px #999; background-color: #eee; width: 50px; height: .5em;"><div style="background-color: #7e7; width: {1}%; height: .5em;"></div></div>{0}</div>'
-
toUploadFormat
: HTML template to use for an item to be uploaded- default: '<div style="overflow: hidden; text-overflow: ellipsis; word-break: break-all; white-space: normal; color: #666; font-style: italic; padding: .25em;">{0}</div>'
-
errorFormat
: HTML template to use for an error- default: '<div style="overflow: hidden; text-overflow: ellipsis; word-break: break-all; white-space: normal; color: #000; padding: .25em;"><div style="float: right; color: #f00; margin-left: .25em;">Error</div>{0}</div>'
-
runtimes
: Known upload runtimes to attempt to use- default: 'gears,silverlight,flash,html5'
-
renderMode
: UI presentation mode. Options are 'default' (full UI), 'dragdrop' (only provides a drag/drop target for file uploading), or 'link' (overrides the behavior of the container to be a link to select a file)- default: 'default'
-
selectFileLabel
: The text rendered on the button used to select a file to upload- default: 'Browse...'
-
initialFileName
: The name of a file that has already been uploaded and should be rendered as an existing file selection- default: ''
Methods
val
Returns the file name of the uploaded file
var fileName = $('SELECTOR').glowUpload('val');
destory
Destroys the upload behavior.
var fileName = $('SELECTOR').glowUpload('destroy');