Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#10264 closed defect (fixed)

no upload with dojox.form.FileUploader (force:html) 1.3.2

Reported by: minobun Owned by: Mike Wilcox
Priority: high Milestone: 1.4
Component: DojoX Form Version: 1.4.0b
Keywords: FileUploader, uploadOnChange, selectMultipleFiles, Cc:
Blocked By: Blocking:

Description

The FileUploader? sends no files if the option uploadOnChange: true OR selectMultipleFiles: false is set. I've only tested this with force:"html" because then i can trace with firebug what the php script got.

<?php
error_reporting(E_ALL);
print_r($_FILES);
?>

response

Array
(
)

Testcase:


<script type="text/javascript">
/*<![CDATA[*/
dojo.require("dojo.parser");
dojo.require("dojox.form.FileUploader");
dojo.addOnLoad(function() {
    var uploader = new dojox.form.FileUploader({
      hoverClass:"btnHover",
      activeClass:"btnActive",
      disabledClass:"btnDisable",
      uploadUrl: "/uploader.php",
      force:"html",
//      selectMultipleFiles: false,
      uploadOnChange: true
    },"btn0");
});
/* ]]> */
</script>
<div id="btn0" class="browse" >Select Images...</div>

Workaround for uploadOnChange: true

dojo.connect(uploader, "onChange", function(data){
	console.log("DATA:", data);
	window.setTimeout(function(){
	  uploader.upload();
	}, 500);
});

Change History (6)

comment:1 Changed 10 years ago by dante

Owner: changed from dante to Mike Wilcox

comment:2 Changed 10 years ago by minobun

Also ie6 and ie7 are stopping at the addOnLoad function if force:html. with a scripterror at line 4685 (dojo.js.uncompressed.js). Message: invalid argument.

dojo.js.uncompressed.js:

       dojo.style = function(	/*DomNode|String*/ node, 
				/*String?|Object?*/ style, 
				/*String?*/ value){
  [..]
  4684 if(args == 3){
> 4685	return op ? d._setOpacity(n, value) : n.style[style] = value; /*Number*/
  4686 }
  [..]

Testcase:

dojo.addOnLoad(function(){
    var uploader = new dojox.form.FileUploader({
      uploadUrl: "/uploader.php",
      force:"html"
    },"btn0");

comment:3 Changed 10 years ago by Mike Wilcox

@minobun, you really should create separate tickets for separate issues. It makes things confusing. Tha 2nd bug is fixed in 1.4, and a workaround is posted in this ticket: http://bugs.dojotoolkit.org/ticket/9615

I'm still looking nto the first issue.

comment:4 Changed 10 years ago by Mike Wilcox

I just plain had neglected to build the input in the case of uploadOnChange. That will be fixed in the next commit. However, I did not see this problem if uploadOnChange is false and multiple false). Let me know if I missed something.

comment:5 Changed 10 years ago by Mike Wilcox

Resolution: fixed
Status: newclosed

(In [20771]) Fixes #10264, #10271, #10313, #10235, #10295 - works in Dialog boxes (still not tabs, that one is harder) - fixed HTML uploader issues. Added new properties to prevent errors of large uploads. Added ability for individual file errors (in Flash).

comment:6 Changed 10 years ago by Mike Wilcox

Milestone: tbd1.4
Note: See TracTickets for help on using tickets.