Opened 14 years ago

Closed 13 years ago

Last modified 12 years ago

#131 closed defect (fixed)

Iframe with mimetype text/plain does not return data

Reported by: Abdur-Rahman Owned by: James Burke
Priority: high Milestone:
Component: General Version: 0.1
Keywords: Cc:
Blocked By: Blocking:

Description

Hi,

I was trying to get fileupload working, and it worked perfect for except one thing. I have no javascript background (only java/c++/c/php/perl) but I didn't get any data back using the handler.

I checked the IframeIO.js file and on line 167 I found the code responsible for returning content, but this didn't work. I tryed to replace "value = ifw.innerHTML;" with "value = ifw.document.body.innerHTML;" and I got the inner html of the body. Don't know how to access the innerHTML of the document or windows object.

I don't know how to work with the xml/javascript object so... couldn't check those..

full code here.....

<html>

<head>

<script language="JavaScript?" type="text/javascript">

Dojo configuration djConfig = { isDebug: true };

</script> <script language="JavaScript?" type="text/javascript"

src="dojo/dojo.js"></script>

<script language="JavaScript?" type="text/javascript">

dojo.require("dojo.io.*"); dojo.require("dojo.io.IframeIO");

var ctr = 0;

function sendIt(){

var bindArgs = {

formNode: document.getElementById("uploadForm"), mimetype: "text/plain", content: {

increment: ctr++, fileFields: "ul1"

}, handle: function(type, data, evt) {

dojo.debug(type); dojo.debug(data); dojo.debug(evt);

}

}; var request = dojo.io.bind(bindArgs);

}

</script>

</head> <body>

<form action="index.php" id="uploadForm"

method="POST" enctype="multipart/form-data">

<input type="text" name="foo" value="bar"> <input type="file" name="ul1"> <input type="button" onclick="sendIt();" value="send it!">

</form>

</body>

</html>

Change History (4)

comment:1 Changed 13 years ago by James Burke

Milestone: 0.3.1
Owner: changed from anonymous to James Burke
Status: newassigned

comment:2 Changed 13 years ago by James Burke

This should be fixed in SVN r4196. If text/plain is used, then it is expected that the return document in the iframe is a .txt file (with the appropriate HTTP Content-Type. See tests/io/test_IframeIO.text.html for a test case. (Having trouble with Safari, but that is bug #672).

comment:3 Changed 13 years ago by James Burke

Resolution: fixed
Status: assignedclosed

comment:4 Changed 12 years ago by (none)

Milestone: 0.3.1

Milestone 0.3.1 deleted

Note: See TracTickets for help on using tickets.