Opened 13 years ago

Closed 12 years ago

#1175 closed defect (wontfix)

The dojo.io upload using the formNode with return type "text/javascript" gives IFrameTransportError" with JSON data.

Reported by: mark.basler@… Owned by: James Burke
Priority: high Milestone: 0.9
Component: IO Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

When using the dojo.io upload that contains a formNode property with return type "text/javascript" I keep getting a "IFrameTransportError" in the data item that is returned. The form being submitted contains an element with the input type of "file". The upload is performed properly, but when the JSON return is sent, I get the "IFrameTransportError" in the data item.

The form upload and return evaluates the JSON properly if the form doesn't contain an element with the input type of "file"

To reproduce the problem I have attached 3 jsp files. One that works (mark_works.jsp), one that doesn't (mark_fails.jsp) and the server side jsp that return the JSON syntax (mark_lookup.jsp).

I am using Dojo 0.3.1 with Firefox 1.5.0.5

Attachments (1)

web.zip (2.0 KB) - added by mark.basler@… 13 years ago.

Download all attachments as: .zip

Change History (5)

Changed 13 years ago by mark.basler@…

Attachment: web.zip added

comment:1 Changed 13 years ago by dylan

Milestone: 0.5

comment:2 Changed 13 years ago by dylan

Owner: changed from alex to James Burke

comment:3 Changed 13 years ago by guest

Hi

Try this patch

lasi@mac:~/devel/publicart/prueba/dojo/src/io$ diff /home/lasi/Desktop/dojo-0.4.1-ajax/src/io/IframeIO.js IframeIO.js
261c261
<                                       var js = ifd.getElementsByTagName("textarea")[0].value;
---
>                                       var js = ifd.getElementsByTagName("pre")[0].innerHTML;
267c267
<                                       value = ifd.getElementsByTagName("textarea")[0].value;
---
>                                       value = ifd.getElementsByTagName("pre")[0].innerHTML;

My version is 0.4.1. Upgrade to it before apply the patch or do it manually.

comment:4 Changed 12 years ago by James Burke

Resolution: wontfix
Status: newclosed

This is working as designed. When using an input type of file, then the IframeTransport? is used, and that transport requires sending the response inside a textarea element inside of an HTML document. This is the only way we get a load notification across browsers when the response is sent.

More info here: http://dojotoolkit.org/book/dojo-book-0-4/part-5-connecting-pieces/i-o/transports/iframe-i-o

For 0.9, you have to explicitly call dojo.io.iframe if you want to deal with forms that have input type files in them. Hopefully this will help make it clearer that the special HTML wrapped return is required.

Note: See TracTickets for help on using tickets.