Opened 8 years ago
Closed 8 years ago
#16796 closed defect (fixed)
[regression] dojox/form/Uploader.upload optional parameter
Reported by: | lzboron | Owned by: | Mike Wilcox |
---|---|---|---|
Priority: | high | Milestone: | 1.9 |
Component: | DojoX Uploader | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
According to documentation and comments function 'upload' of dojox/form/Uploader has one optional parameter 'formData', but it contains this code:
formData.uploadType = this.uploadType;
Also function 'uploadIFrame' in 'uploader/_IFrame.js' and function 'uploadFlash' in 'uploader/_Flash.js' contain similar code, which fails, when no parameter is provided.
Older versions of Uploader (1.7) did not require this parameter.
Change History (10)
comment:1 Changed 8 years ago by
Component: | DojoX Form → DojoX Uploader |
---|---|
Owner: | changed from dante to Mike Wilcox |
comment:2 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|---|
Priority: | undecided → high |
comment:3 Changed 8 years ago by
Summary: | dojox/form/Uploader.upload optional parameter → [regression] dojox/form/Uploader.upload optional parameter |
---|
comment:5 Changed 8 years ago by
I do not think this is fixed. I upload files programatically by calling upload function on uploader. This function looks like this:
//Uploader.js upload: function(/*Object?*/ formData){ // summary: // When called, begins file upload. Only supported with plugins. formData.uploadType = this.uploadType; this.inherited(arguments); }, //_Flash.js uploadFlash: function(/*Object ? */ formData){ // summary: // Uploads selected files. Alias "upload()" should be used instead. // tags: // private this.onBegin(this.getFileList()); formData.returnType = "F"; formData.uploadType = this.uploadType; console.log('flas upload', formData); this.flashMovie.doUpload(formData); }, //_IFrame.js uploadIFrame: function(data){ // summary: // Internal. You could use this, but you should use upload() or submit(); // which can also handle the post data. var formObject = {}, sendForm, form = this.getForm(), url = this.getUrl(), self = this; data.uploadType = this.uploadType; ... }
All these functions will fail if no formData is provided.
You can also see test dojox/form/tests/test_Uploader_programmatic.html. Click upload button in dialog and you will get error.
comment:7 Changed 8 years ago by
Ok, it wasn't clear what you were asking for. I think this fixes it.
comment:8 Changed 8 years ago by
Thank you for fix, it works well for HTML5 upload. Same check should be added to IFrame and Flash plugins, because they override Uploader's upload function with their uploadIFrame and uploadFlash functions.
comment:9 Changed 8 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Reopening to get fix in plugins (assuming above comment is valid).
This one looks like a fairly strong regression.