简体   繁体   English

dojo 1.6中的dojox.form.Uploader问题

[英]Issue with dojox.form.Uploader in dojo 1.6

I've tried every variant, programmatic and declarative with no success. 我尝试过各种变体,无论是程序化还是声明式,都没有成功。

I'm having troubles using the dojox.form.Uploader, is seems to work just fine in version 1.10 but in 1.6 doesn't. 我在使用dojox.form.Uploader时遇到了麻烦,在1.10版中似乎工作正常,但在1.6版中却没有。 When I select the file, nothing happens, even if the uploadOnSelect option is set as true. 当我选择文件时,即使将uploadOnSelect选项设置为true,也不会发生任何事情。

I've no intention to upgrade to 1.10 due to company policies and because the main application is in 1.6, so, if I use 1.10 it causes compatibility issues. 由于公司政策和主应用程序在1.6中,因此我无意升级到1.10,因此,如果我使用1.10,则会导致兼容性问题。 I just want to be able to upload a file by ajax (HTML5). 我只希望能够通过ajax(HTML5)上传文件。

Here is an example of how I'm creating the uploader: 这是我如何创建上传器的示例:

btn_upload_csv[i] = new dojox.form.Uploader({label:"Programmatic Uploader", multiple:true, uploadOnSelect:true, url:"UploadFile.php"});

If it is no possible to use a module from a higher version, what options do I have? 如果无法使用更高版本的模块,我有哪些选择?

Here is an example of what I've so far https://jsfiddle.net/0exeLpmn/2/ 这是我到目前为止https://jsfiddle.net/0exeLpmn/2/的示例

It just needed to startup the widget like: 它只需要启动小部件,如:

btn_uploader.startup();

Here is an example: https://jsfiddle.net/0exeLpmn/3/ 这是一个示例: https : //jsfiddle.net/0exeLpmn/3/

(to check if this works open your browser's console and see the post request been made) (要检查此方法是否有效,请打开浏览器的控制台并查看发出的发帖请求)

I can't believe this isn't in the documentation. 我不敢相信这不在文档中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM