在DOJO中拖放文件上传

时间:2011-08-21 18:28:07

标签: dojo drag-and-drop

DOJO中是否有一个选项,可以通过拖放将文件从桌面上传到浏览器?

2 个答案:

答案 0 :(得分:0)

不,我不相信。如上所述[{3}}和here,如果不使用插件,它就无法实现。

答案 1 :(得分:0)

旧帖子,但Google仍然很容易找到这些帖子之一。对于那些对此感兴趣的人:

createUploader: function() {

  // ... define uploader and droptarget

  d_on(this.dropArea, "dragover", d_lang.hitch(this, this.dropAreaOver));
  d_on(this.dropArea, "dragleave", d_lang.hitch(this, this.dropAreaLeave));
  d_on(this.dropArea, "drop", d_lang.hitch(this, this.dropAreaLeave));
}

dropAreaOver: function(evt) {
    evt.preventDefault();
    domClass.add(this.dropArea, "dropAreaOver");
},


dropAreaLeave: function(evt) {
    evt.preventDefault();
    domClass.remove(this.dropArea, "dropAreaOver");
}