#12411 closed defect (fixed)
[patch] dojox.form.uploader.plugins.HTML5 : form field name is hard-coded to "uploadedfiles"
Reported by: | talisto | Owned by: | Kenneth G. Franqueiro |
---|---|---|---|
Priority: | high | Milestone: | 1.6.1 |
Component: | DojoX Form | Version: | 1.6.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
the dojox.form.Uploader should use the "name" attribute for the form field name, however the HTML5 plugin has the field name hardcoded to "uploadedfiles".
The default name in Uploader.js is "uploadedfile", and the HTML5's field name should be plural, so the name in the HTML5 plugin should actually be this.name + 's'.
I've attached a patch file to resolve the issue.
Attachments (1)
Change History (9)
Changed 10 years ago by
Attachment: | HTML5.js.patch added |
---|
comment:1 Changed 10 years ago by
Owner: | changed from dante to Mike Wilcox |
---|---|
Summary: | dojox.form.uploader.plugins.HTML5 : form field name is hard-coded to "uploadedfiles" → [patch] dojox.form.uploader.plugins.HTML5 : form field name is hard-coded to "uploadedfiles" |
comment:2 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 Changed 10 years ago by
Milestone: | tbd → 1.7 |
---|
comment:4 Changed 10 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Unfortunately this isn't entirely fixed yet; the forEach loop needs "this" scope, so the following needs to be changed (line 94):
dojo.forEach(this.inputNode.files, function(f, i){ fd.append(this.name+"s[]", f); });
to:
dojo.forEach(this.inputNode.files, function(f, i){ fd.append(this.name+"s[]", f); },this);
I s'pose this would have been easier if I hadn't bungled my previous patch (I diff'ed in the wrong order, d'ohh).
comment:6 Changed 10 years ago by
Owner: | changed from Mike Wilcox to Kenneth G. Franqueiro |
---|---|
Status: | reopened → new |
[24248] by mwilcox fixes the issue raised yesterday by talisto in trunk (man, trac's really falling asleep at the helm tonight).
I'll port both changes to 1.6.
comment:7 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:8 Changed 9 years ago by
I am uploading multiple files to a servlet (MultipartHandler?). The issue I am seeing is that all files have a name as uploadedFiles[] in the disposition line instead uploadedFiles[0], uploadedFiles[1] and so on.
Now if I change
fd.append(this.name+"s[]", f);
to
fd.append(this.name+"s[" + i "]", f);
the it works fine. What I wanted to know was whether this is a bug or should the Multipart handler servlet handle this.
It's a trivial patch, we don't need a CLA (although please file one if you give bigger patches, thanks!)