new UWA.Services.Upload(options)
UWA.Services.Upload constructor.
Example
var myService = new UWA.Services.Upload({
onUploadSuccess: Bookmarks.onUploadSuccess,
onUploadFailed: Bookmarks.onUploadFailed,
onUpload: Bookmarks.onUpload,
formElement: uploadForm,
frameIdPrefix: 'Bookmarks',
urls: {
statusScript: 'http://www.netvibes.com/api/my/bookmarks/import/status',
uploadScript: 'http://www.netvibes.com/api/my/bookmarks/import'
}
});
Parameters
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Options hash Properties
|
Index
Methods
-
buildIframe() → {Number}
-
Inject Upload iframe to current HTML page.
Returns
Id of the recently created frame
- Type
- Number
-
buildFormRequirements(frameId)
-
Add form requirements (multipart option, hidden fields...) usefull for Upload component to do its job.
Parameters
Name Type Description frameId
Number Id of the frame
-
setTimer(frameId)
-
Fire this.checkStatus each this.options.poll microseconds unless this.options.timeout is reached
Parameters
Name Type Description frameId
Number Id of the frame
-
checkStatus(frameId)
-
Ask to status endpoint the upload status.
Parameters
Name Type Description frameId
Number Id of the frame