<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: File uploading with Dojo</title>
	<atom:link href="http://infrequently.org/2005/12/file-uploading-with-dojo/feed/" rel="self" type="application/rss+xml" />
	<link>http://infrequently.org/2005/12/file-uploading-with-dojo/</link>
	<description></description>
	<lastBuildDate>Thu, 10 May 2012 17:22:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Dirk</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-235565</link>
		<dc:creator>Dirk</dc:creator>
		<pubDate>Sun, 18 Jan 2009 23:33:54 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-235565</guid>
		<description>Note: This article is not valid for the current version of dojo. If you are getting an error like

Could not load &#039;dojo.io.*&#039;; last tried &#039;.io/*.js&#039;
or
Could not load &#039;dojo.io.IframeIO&#039;; last tried &#039;.io/IframeIO.js&#039;

it&#039;s because you&#039;re using a later version of dojo.

For io with these versions, see this link:
http://www.dojotoolkit.org/book/dojo-porting-guide-0-4-x-0-9/io-transports-ajax
or
http://www.dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/ajax-transports/alternate-transports</description>
		<content:encoded><![CDATA[<p>Note: This article is not valid for the current version of dojo. If you are getting an error like</p>
<p>Could not load &#8216;dojo.io.*&#8217;; last tried &#8216;.io/*.js&#8217;<br />
or<br />
Could not load &#8216;dojo.io.IframeIO&#8217;; last tried &#8216;.io/IframeIO.js&#8217;</p>
<p>it&#8217;s because you&#8217;re using a later version of dojo.</p>
<p>For io with these versions, see this link:<br />
<a href="http://www.dojotoolkit.org/book/dojo-porting-guide-0-4-x-0-9/io-transports-ajax" rel="nofollow">http://www.dojotoolkit.org/book/dojo-porting-guide-0-4-x-0-9/io-transports-ajax</a><br />
or<br />
<a href="http://www.dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/ajax-transports/alternate-transports" rel="nofollow">http://www.dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/ajax-transports/alternate-transports</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Petruha</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-89344</link>
		<dc:creator>Petruha</dc:creator>
		<pubDate>Fri, 16 Mar 2007 11:06:21 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-89344</guid>
		<description>&lt;b&gt;Concurrent file upload problem!!!&lt;/b&gt;

  Hi, everybody!

&#160; I&#039;ve met strange problem using dojo to upload files. I have simple form with an input of type &#039;file&#039;, and using dojo.bind() to submit this form. It works perfect if I&#039;m uploading a single file. But if I submit this form once, and right after that (don&#039;t wait until the file is uploaded) select another file and submit the form again, I have next result: the first file is in fact uploaded, but second is not, and if after that I try to upload another file it fails as well without any notifications/errors.

&#160; I tried to investigate this issue using sniffer and found that browser stucks and does not send any data in such situation.</description>
		<content:encoded><![CDATA[<p><b>Concurrent file upload problem!!!</b></p>
<p>  Hi, everybody!</p>
<p>&nbsp; I&#8217;ve met strange problem using dojo to upload files. I have simple form with an input of type &#8216;file&#8217;, and using dojo.bind() to submit this form. It works perfect if I&#8217;m uploading a single file. But if I submit this form once, and right after that (don&#8217;t wait until the file is uploaded) select another file and submit the form again, I have next result: the first file is in fact uploaded, but second is not, and if after that I try to upload another file it fails as well without any notifications/errors.</p>
<p>&nbsp; I tried to investigate this issue using sniffer and found that browser stucks and does not send any data in such situation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-84126</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Tue, 27 Feb 2007 23:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-84126</guid>
		<description>Hi Alex, 

I&#039;m having an interesting problem related to IFrameIO. When I have a input of type=&quot;file&quot; and do an upload via IframeIO I get strange rendering problems in Firefox 2. After any IFrameIO action is carried out, switching to other tabs in my tab container causes the entire browser screen to flash white as certain  widgets are rendered.

I&#039;ve narrowed it down to the presence of widgets created through script versus versus widgets defined in HTML markup in my test page. Only script created widgets cause the screen flash and it only happens in Firefox. 

Thank you,
Nathan</description>
		<content:encoded><![CDATA[<p>Hi Alex, </p>
<p>I&#8217;m having an interesting problem related to IFrameIO. When I have a input of type=&#8221;file&#8221; and do an upload via IframeIO I get strange rendering problems in Firefox 2. After any IFrameIO action is carried out, switching to other tabs in my tab container causes the entire browser screen to flash white as certain  widgets are rendered.</p>
<p>I&#8217;ve narrowed it down to the presence of widgets created through script versus versus widgets defined in HTML markup in my test page. Only script created widgets cause the screen flash and it only happens in Firefox. </p>
<p>Thank you,<br />
Nathan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lasizoillo</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-72749</link>
		<dc:creator>lasizoillo</dc:creator>
		<pubDate>Thu, 18 Jan 2007 11:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-72749</guid>
		<description>&lt;a href=&quot;http://trac.dojotoolkit.org/ticket/1175&quot; rel=&quot;nofollow&quot;&gt;Ticket &lt;/a&gt;info about &#039;text/javascript&#039; bug.</description>
		<content:encoded><![CDATA[<p><a href="http://trac.dojotoolkit.org/ticket/1175" rel="nofollow">Ticket </a>info about &#8216;text/javascript&#8217; bug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MizardX</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-57542</link>
		<dc:creator>MizardX</dc:creator>
		<pubDate>Mon, 13 Nov 2006 09:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-57542</guid>
		<description>To retrieve text from an iframe you have to specify minetype: text/plain in the request AND return html with an textarea in the response. Also, IFrameIO seem to ignore the handler-function, so always use load().
&lt;blockquote&gt;dojo.require(&#039;dojo.io.IFrameIO&#039;);
...
dojo.io.bind({
 &#160;&#160; formNode: dojo.byId(&#039;myForm&#039;),
&#160;&#160;&#160; mimetype: &#039;text/plain&#039;,
&#160;&#160;&#160; load: function(type, msg) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160; window.alert(&#039;Success: &#039; + msg);
&#160;&#160;&#160; }
&#160;&#160;&#160; error: function(type, err) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160; window.alert(&#039;Failure: &#039; + err.message);
&#160;&#160;&#160; }
});
...
&lt;form id=&quot;myForm&quot; action=&quot;myscript.php&quot; method=&quot;post&quot;&gt;
&lt;input type=&quot;submit&quot; /&gt;
&lt;/form&gt;
&lt;/blockquote&gt;And then the resonse have to look something like:
&lt;blockquote&gt;&lt;html&gt;
&lt;body&gt;
&lt;textarea&gt;Hello World!&lt;/textarea&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/blockquote&gt;If you specify mimetype: text/html you will get the document-object itself.
&lt;blockquote&gt;dojo.io.bind({

&#160;&#160;&#160; formNode: dojo.byId( &#039;myForm&#039; ),

&#160;&#160;&#160; mimetype: &#039;text/html&#039;,

&#160;&#160;&#160; load: function(type, doc) {

&#160;&#160;&#160;&#160;&#160;&#160;&#160; window.alert( doc.getElementsByTagName( &#039;textarea&#039; )[0].value );

&#160;&#160;&#160; }
&#160;&#160;&#160; error: function(type, err) {

&#160;&#160;&#160;&#160;&#160;&#160;&#160; window.alert(&#039;Failure: &#039; + err.message);
&#160;&#160;&#160; }

});

&lt;/blockquote&gt;</description>
		<content:encoded><![CDATA[<p>To retrieve text from an iframe you have to specify minetype: text/plain in the request AND return html with an textarea in the response. Also, IFrameIO seem to ignore the handler-function, so always use load().</p>
<blockquote><p>dojo.require(&#8216;dojo.io.IFrameIO&#8217;);<br />
&#8230;<br />
dojo.io.bind({<br />
 &nbsp;&nbsp; formNode: dojo.byId(&#8216;myForm&#8217;),<br />
&nbsp;&nbsp;&nbsp; mimetype: &#8216;text/plain&#8217;,<br />
&nbsp;&nbsp;&nbsp; load: function(type, msg) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; window.alert(&#8216;Success: &#8216; + msg);<br />
&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; error: function(type, err) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; window.alert(&#8216;Failure: &#8216; + err.message);<br />
&nbsp;&nbsp;&nbsp; }<br />
});<br />
&#8230;<br />
&lt;form id=&#8221;myForm&#8221; action=&#8221;myscript.php&#8221; method=&#8221;post&#8221;&gt;<br />
&lt;input type=&#8221;submit&#8221; /&gt;<br />
&lt;/form&gt;
</p></blockquote>
<p>And then the resonse have to look something like:</p>
<blockquote><p>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;textarea&gt;Hello World!&lt;/textarea&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;
</p></blockquote>
<p>If you specify mimetype: text/html you will get the document-object itself.</p>
<blockquote><p>dojo.io.bind({</p>
<p>&nbsp;&nbsp;&nbsp; formNode: dojo.byId( &#8216;myForm&#8217; ),</p>
<p>&nbsp;&nbsp;&nbsp; mimetype: &#8216;text/html&#8217;,</p>
<p>&nbsp;&nbsp;&nbsp; load: function(type, doc) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; window.alert( doc.getElementsByTagName( &#8216;textarea&#8217; )[0].value );</p>
<p>&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; error: function(type, err) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; window.alert(&#8216;Failure: &#8216; + err.message);<br />
&nbsp;&nbsp;&nbsp; }</p>
<p>});</p>
</blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravindranath</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-51798</link>
		<dc:creator>Ravindranath</dc:creator>
		<pubDate>Tue, 31 Oct 2006 09:10:57 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-51798</guid>
		<description>Hi All,
 &#160;&#160;&#160;&#160;&#160;&#160;&#160; In Internet Explorer i&#160;could not able get all the style classes and fonts. Every time&#160;I&#160;login,&#160;I&#160;am getting errors as &quot;This object cannot be loaded&quot;. In my colleagues system it is showing all the syle classes related to it and fonts clearly. This problem&#160;didnt get resolved even if i reinstall my Internet Explorer. Can you please resolve this problem....
Thanks,
Ravindranath.</description>
		<content:encoded><![CDATA[<p>Hi All,<br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In Internet Explorer i&nbsp;could not able get all the style classes and fonts. Every time&nbsp;I&nbsp;login,&nbsp;I&nbsp;am getting errors as &#8220;This object cannot be loaded&#8221;. In my colleagues system it is showing all the syle classes related to it and fonts clearly. This problem&nbsp;didnt get resolved even if i reinstall my Internet Explorer. Can you please resolve this problem&#8230;.<br />
Thanks,<br />
Ravindranath.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Troy</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-45834</link>
		<dc:creator>Troy</dc:creator>
		<pubDate>Wed, 20 Sep 2006 15:34:39 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-45834</guid>
		<description>Great post Alex, thanks!  Now I am wondering if anyone can shed some light on a debug error message that shows up.&#160; At first I thought it was a bug with my code but when I try&#160; http://download.dojotoolkit.org/release-0.3.1/dojo-0.3.1-ajax/tests/io/test_IframeIO.html I receive&#160; this:

DEBUG:  Type: errorDEBUG:  Response: [object Object]

Which I can faithfully reproduce with my own code :)

Oh, the file does get successfully uploaded.
</description>
		<content:encoded><![CDATA[<p>Great post Alex, thanks!  Now I am wondering if anyone can shed some light on a debug error message that shows up.&nbsp; At first I thought it was a bug with my code but when I try&nbsp; <a href="http://download.dojotoolkit.org/release-0.3.1/dojo-0.3.1-ajax/tests/io/test_IframeIO.html" rel="nofollow">http://download.dojotoolkit.org/release-0.3.1/dojo-0.3.1-ajax/tests/io/test_IframeIO.html</a> I receive&nbsp; this:</p>
<p>DEBUG:  Type: errorDEBUG:  Response: [object Object]</p>
<p>Which I can faithfully reproduce with my own code <img src='http://infrequently.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Oh, the file does get successfully uploaded.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cakriwut</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-44337</link>
		<dc:creator>Cakriwut</dc:creator>
		<pubDate>Wed, 23 Aug 2006 16:47:07 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-44337</guid>
		<description>I don&#039;t think dojo can check file size. But, we can use small activeX instead.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think dojo can check file size. But, we can use small activeX instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Palmer</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-44297</link>
		<dc:creator>Charles Palmer</dc:creator>
		<pubDate>Wed, 23 Aug 2006 09:30:51 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-44297</guid>
		<description>Like many posting here, I had a great deal of trouble working out how to upload files. The documentation is not explicit enough. I&#039;ve finally worked something out, and I have put the files I used on my website (though they don&#039;t actually run from there - you&#039;ll have to download them and install them on your own system). There is an &lt;a href=&quot;http://www.acutetechnology.com/projects/public/dojo_file_upload/upload.html&quot; rel=&quot;nofollow&quot;&gt;HTML file&lt;/a&gt; and a &lt;a href=&quot;http://www.acutetechnology.com/projects/public/dojo_file_upload/echoForms.txt&quot; rel=&quot;nofollow&quot;&gt;PHP file&lt;/a&gt;.

I found that to get the upload working requires several things:

The form must contain these attributes: method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;The script on the server must report that it is returning HTML - with php this is done as follows: header(&#039;Content-type: text/html&#039;);The script then must return an HTML document, which contains a textarea. Place the actual message that you want delivered within the textarea.
If you don&#039;t do this you&#039;ll get an error of some sort, such as an &quot;IFrameTransportError&quot;, or error messages from dojo.

Gentle request to Dojo documenters - more live working examples please?</description>
		<content:encoded><![CDATA[<p>Like many posting here, I had a great deal of trouble working out how to upload files. The documentation is not explicit enough. I&#8217;ve finally worked something out, and I have put the files I used on my website (though they don&#8217;t actually run from there &#8211; you&#8217;ll have to download them and install them on your own system). There is an <a href="http://www.acutetechnology.com/projects/public/dojo_file_upload/upload.html" rel="nofollow">HTML file</a> and a <a href="http://www.acutetechnology.com/projects/public/dojo_file_upload/echoForms.txt" rel="nofollow">PHP file</a>.</p>
<p>I found that to get the upload working requires several things:</p>
<p>The form must contain these attributes: method=&#8221;post&#8221; enctype=&#8221;multipart/form-data&#8221;The script on the server must report that it is returning HTML &#8211; with php this is done as follows: header(&#8216;Content-type: text/html&#8217;);The script then must return an HTML document, which contains a textarea. Place the actual message that you want delivered within the textarea.<br />
If you don&#8217;t do this you&#8217;ll get an error of some sort, such as an &#8220;IFrameTransportError&#8221;, or error messages from dojo.</p>
<p>Gentle request to Dojo documenters &#8211; more live working examples please?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-43148</link>
		<dc:creator>john</dc:creator>
		<pubDate>Sat, 19 Aug 2006 23:53:12 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-43148</guid>
		<description>Can dojo check file size before uploading it?
Yes, it is always possbile to check on server side, but bandwidth
has been wasted.</description>
		<content:encoded><![CDATA[<p>Can dojo check file size before uploading it?<br />
Yes, it is always possbile to check on server side, but bandwidth<br />
has been wasted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cakriwut</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-43055</link>
		<dc:creator>Cakriwut</dc:creator>
		<pubDate>Wed, 16 Aug 2006 09:27:44 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-43055</guid>
		<description>How do you partially upload a large file? Suppose you have 50 MB file on dialup link. Can we do partiall upload? ADODB.Stream is not the answer, because it open IE security hole.&#160;</description>
		<content:encoded><![CDATA[<p>How do you partially upload a large file? Suppose you have 50 MB file on dialup link. Can we do partiall upload? ADODB.Stream is not the answer, because it open IE security hole.&nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jonathan</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-42755</link>
		<dc:creator>jonathan</dc:creator>
		<pubDate>Mon, 07 Aug 2006 04:26:58 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-42755</guid>
		<description>Hi, I tried to upload a multipart form with file and got an IFrameTransport error, however the file is uploaded correctly onto the server. any idea why?
Here&#039;s my code:
[code]
	function upload_file(formNode){
		
		var bindArgs = {
    		url:        &quot;foo.php&quot;,
    		mimetype:   &quot;text/javascript&quot;,
    		error:      function(type, errObj){
        		// handle error here
				alert(&quot;error &quot;+errObj.message);
    		},
    		load:      function(type, data, evt){
        		// handle successful response here
    			alert(&quot;done&quot;);
			
			},
			formNode: formNode 
		};

		// dispatch the request
    	var requestObj = dojo.io.bind(bindArgs);
	}
[/code]</description>
		<content:encoded><![CDATA[<p>Hi, I tried to upload a multipart form with file and got an IFrameTransport error, however the file is uploaded correctly onto the server. any idea why?<br />
Here&#8217;s my code:<br />
[code]<br />
	function upload_file(formNode){</p>
<p>		var bindArgs = {<br />
    		url:        "foo.php",<br />
    		mimetype:   "text/javascript",<br />
    		error:      function(type, errObj){<br />
        		// handle error here<br />
				alert("error "+errObj.message);<br />
    		},<br />
    		load:      function(type, data, evt){<br />
        		// handle successful response here<br />
    			alert("done");</p>
<p>			},<br />
			formNode: formNode<br />
		};</p>
<p>		// dispatch the request<br />
    	var requestObj = dojo.io.bind(bindArgs);<br />
	}<br />
[/code]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shahryar</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-40607</link>
		<dc:creator>shahryar</dc:creator>
		<pubDate>Mon, 12 Jun 2006 16:23:51 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-40607</guid>
		<description>Hi,

I am trying to upload files ... although I can easily get the response but the file upload does not work.

server side code (in PHP) is as folllows 

header(&#039;Content-type: text/html&#039;);

$uploadDir	=	&#039;./&#039;;
$uploadFile	=	$uploadDir.basename($_FILES[&#039;file_name&#039;][&#039;name&#039;]);

if (	move_uploaded_file(	$_FILES[&#039;file_name&#039;][&#039;tmp_name&#039;], $uploadFile) )
{
	echo	&quot;&quot;;
	echo	&quot;&quot;.$_FILES[&#039;file_name&#039;][&#039;name&#039;].&quot; uploaded successfully....&quot;;
	echo	&quot;&quot;;
}
else
{
	echo	&quot;&quot;;
	echo	&quot;&quot;.$_FILES[&#039;file_name&#039;][&#039;name&#039;].&quot; could not be uploaded successfully....&quot;;
	echo	&quot;&quot;;
}

client side is as follows



	dojo.require(&quot;dojo.io.*&quot;);
	dojo.require(&quot;dojo.io.IframeIO&quot;);

	var ctr = 0;
	var foo;

	function sendIt(){
		var bindArgs = {
				formNode: document.getElementById(&quot;uploadForm&quot;),
				mimetype: &quot;text/html&quot;,
				content: {
					increment: ctr++,
					fileFields: &quot;ul1&quot;
				},
					
				handler: function(type, data, evt){
					// handle successful response here
					if(type	==	&quot;error&quot;)
					{
						alert(&quot;Unknown error occurred.&quot;);
					}
					else
					{
						res = dojo.byId(&quot;dojoIoIframe&quot;).contentWindow.document.getElementById(&quot;output&quot;).innerHTML;
						alert(res);					
					}
//					alert(data);
				}				
			};
			var request = dojo.io.bind(bindArgs);
		}



When I run this code I get &quot;[filename] could not be uploaded successfully....&quot; error.

Please help me with this 
thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I am trying to upload files &#8230; although I can easily get the response but the file upload does not work.</p>
<p>server side code (in PHP) is as folllows </p>
<p>header(&#8216;Content-type: text/html&#8217;);</p>
<p>$uploadDir	=	&#8216;./&#8217;;<br />
$uploadFile	=	$uploadDir.basename($_FILES['file_name']['name']);</p>
<p>if (	move_uploaded_file(	$_FILES['file_name']['tmp_name'], $uploadFile) )<br />
{<br />
	echo	&#8220;&#8221;;<br />
	echo	&#8220;&#8221;.$_FILES['file_name']['name'].&#8221; uploaded successfully&#8230;.&#8221;;<br />
	echo	&#8220;&#8221;;<br />
}<br />
else<br />
{<br />
	echo	&#8220;&#8221;;<br />
	echo	&#8220;&#8221;.$_FILES['file_name']['name'].&#8221; could not be uploaded successfully&#8230;.&#8221;;<br />
	echo	&#8220;&#8221;;<br />
}</p>
<p>client side is as follows</p>
<p>	dojo.require(&#8220;dojo.io.*&#8221;);<br />
	dojo.require(&#8220;dojo.io.IframeIO&#8221;);</p>
<p>	var ctr = 0;<br />
	var foo;</p>
<p>	function sendIt(){<br />
		var bindArgs = {<br />
				formNode: document.getElementById(&#8220;uploadForm&#8221;),<br />
				mimetype: &#8220;text/html&#8221;,<br />
				content: {<br />
					increment: ctr++,<br />
					fileFields: &#8220;ul1&#8243;<br />
				},</p>
<p>				handler: function(type, data, evt){<br />
					// handle successful response here<br />
					if(type	==	&#8220;error&#8221;)<br />
					{<br />
						alert(&#8220;Unknown error occurred.&#8221;);<br />
					}<br />
					else<br />
					{<br />
						res = dojo.byId(&#8220;dojoIoIframe&#8221;).contentWindow.document.getElementById(&#8220;output&#8221;).innerHTML;<br />
						alert(res);<br />
					}<br />
//					alert(data);<br />
				}<br />
			};<br />
			var request = dojo.io.bind(bindArgs);<br />
		}</p>
<p>When I run this code I get &#8220;[filename] could not be uploaded successfully&#8230;.&#8221; error.</p>
<p>Please help me with this<br />
thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JonathanAquino</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-12659</link>
		<dc:creator>JonathanAquino</dc:creator>
		<pubDate>Sun, 14 May 2006 06:06:04 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-12659</guid>
		<description>Phillip - There&#039;s a bug with text/plain (causing it to return undefined) but you can work around it by extracting the IFrame contents manually - http://trac.dojotoolkit.org/ticket/674</description>
		<content:encoded><![CDATA[<p>Phillip &#8211; There&#8217;s a bug with text/plain (causing it to return undefined) but you can work around it by extracting the IFrame contents manually &#8211; <a href="http://trac.dojotoolkit.org/ticket/674" rel="nofollow">http://trac.dojotoolkit.org/ticket/674</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phillip</title>
		<link>http://infrequently.org/2005/12/file-uploading-with-dojo/comment-page-1/#comment-10903</link>
		<dc:creator>Phillip</dc:creator>
		<pubDate>Tue, 09 May 2006 12:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://alex.dojotoolkit.org/?p=528#comment-10903</guid>
		<description>If I set dojo mimetype with text/plain it shows:
DEBUG: Type: load
DEBUG: Response: undefined

with text/javascript:
DEBUG: Type: error
DEBUG: Response: [object Object]

and in this case I don&#039;t know what to do with the object</description>
		<content:encoded><![CDATA[<p>If I set dojo mimetype with text/plain it shows:<br />
DEBUG: Type: load<br />
DEBUG: Response: undefined</p>
<p>with text/javascript:<br />
DEBUG: Type: error<br />
DEBUG: Response: [object Object]</p>
<p>and in this case I don&#8217;t know what to do with the object</p>
]]></content:encoded>
	</item>
</channel>
</rss>

