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 (0 for unlimited).- default: '0'
-
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: '/'
-
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>'
-
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: ''
-
contentTypeId
: The Guid ID of the content type into which this file will be stored.- default: null
-
applicationTypeId
: The Guid ID of the application type into which this file will be stored.- default: null
-
applicationId
: The Guid ID of the application into which this file will be stored.- default: null
-
type
: The type of file being uploaded (used for validation). Options are: 'Image'- default: null
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');