"No Dropzone found for given element" error when upload heavy files

时间:2016-12-02 04:56:18

标签: javascript jquery dropzone.js

I'm having an issue with dropzone.js where it reports this issue when uploading many "big" files (by big I mean 3-5MB each)

Uncaught Error: No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the init option to setup any additional observers on your Dropzone

Everything works fine with uploading small files (100-300kbs)

Does anybody know what's happening here?

1 个答案:

答案 0 :(得分:0)

您可能忘记给dropzone一个ID。

您可以通过以下方式使用该组件。

{{drop-zone url='http://localhost/dummy' addfilehere=(action "addfilehere")
 id="uniqueID" addRemoveLinks=true autoProcessQueue=false}}

在您使用dropzone的组件中,您可以添加以下对ID的引用

this.set('dropzone', Dropzone.forElement('#uniqueID'));