Opened 14 years ago
Closed 14 years ago
#5904 closed defect (fixed)
[Patch - CLA] File transfers (iframe.js) fail during second file upload
Reported by: | guest | Owned by: | James Burke |
---|---|---|---|
Priority: | high | Milestone: | 1.1 |
Component: | IO | Version: | 1.0 |
Keywords: | iframe file form ie dojo.io | Cc: | |
Blocked By: | Blocking: |
Description
When uploading a file using iframeIO (iframe.js) and Dojo 1.0.1 the first submission succeeds but the second submission fails.
This is recreatable quite easily using embedded IE7 but I have seen reports by phiggins and others that they have experienced it as well.
Excerpt of dojo.:
var bindArgs = { url: myUrl, form: dojo.byId(formId), method: "post", handleAs: 'json', preventCache: true, content: { increment: ctr++, name: strFormFileSource, filename: myFileName } } var request = dojo.io.iframe.send(bindArgs);
The second request results in an error. Debugging (VS) shows that in iframe.doc() the passed iframeNode does not have access to it's contentWindow:
iframeNode.contentWindow Object doesn't support this property or method
However, accessing this node via a manual fetch to the iframe does give us access to the iframe.contentWindow:
(document.getElementsByTagName("iframe")[iframeNode.name].contentWindow.document)
The patch which addresses this is attached (and below). It has been used for 2 months and no problems in IE reported by those using it.
CLA on file for "Matthew Knapp"
Patch Generated by SVN:
Index: iframe.js =================================================================== --- iframe.js (revision 11817) +++ iframe.js (working copy) @@ -99,7 +99,8 @@ //summary: Returns the document object associated with the iframe DOM Node argument. var doc = iframeNode.contentDocument || // W3 ( - (iframeNode.contentWindow)&&(iframeNode.contentWindow.document) + ((iframeNode.name)&&(iframeNode.document)&&(document.getElementsByTagName("iframe")[iframeNode.name].contentWindow) + &&(document.getElementsByTagName("iframe")[iframeNode.name].contentWindow.document)) ) || // IE ( (iframeNode.name)&&(document.frames[iframeNode.name])&&
Attachments (1)
Change History (3)
Changed 14 years ago by
Attachment: | iframe.js.diff added |
---|
comment:1 Changed 14 years ago by
Milestone: | → 1.1 |
---|
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch for iframe.js