Dropzone.js - maxFilesize增加不起作用 [英] Dropzone.js - maxFilesize increase not working

查看:706
本文介绍了Dropzone.js - maxFilesize增加不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的网站使用 Dropzone.js 。我需要上传大于500MB的默认 maxFilesize



我试图改变 .js文件中的数字。现在该文件似乎被接受,但上传中没有(可见的)进度。该文件没有红十字会,并坚持在上传的百分之零。



任何想法,我可能做错了什么?或者是这样的错误?



谢谢!

解决方案

我只是在Chrome中测试它,它工作正常。 (您正在使用哪个浏览器?)

这可能是因为您的上传时间过长,您无法立即看到更新。

$ b首先,你不应该改变 .js 文件本身的属性。这样,您将无法升级到更新版本的Dropzone,而无需担心。因此,请按照网站上推荐的方式配置您的dropzone。



关于上传,如果不仔细查看,可能很难判断出错。我的建议是,你在状态更新上添加了一些调试信息,看看它是否真的只是你的上传速度很慢。



试试这个代码,看看如果它不能解决你的问题:
$ b

 < form id =my-dropzone action =/ targetclass =dropzone>< / form> 

< script>
Dropzone.options.myDropzone = {
maxFilesize:500,
init:function(){
this.on(uploadprogress,function(file,progress){
console.log(File progress,进度);
});
}
}
< / script>

如果您可以定期看到控制台输出,那么上传工作正常,但只需要一段时间完成。


I'm using Dropzone.js for my website. I'm in the need of uploading bigger files than the default maxFilesize of 500MB.

I tried to change the number in the .js file. Now the file seems to be accepted but there is no (visible?) progress in the upload. The file has no red cross and is stuck at zero percent of the upload.

Any ideas what I might be doing wrong? Or is this some kind of bug?

Thanks!

解决方案

I just tested it in Chrome and it worked fine. (Which browser are you using?)

It might be that your upload is just taking so long that you don't see an update immediately.

First things first: you shouldn't change properties in the .js file itself. This way you wont be able to upgrade to a newer version of Dropzone without headaches. So configure your dropzone the way it's recommended on the website.

About the upload,... it's really hard to tell what might be wrong without a look at it. What I suggest, is that you add some kind of debugging information on the status updates, to see if it's really just your upload being very slow.

Try this code and see if it doesn't solve your problem:

<form id="my-dropzone" action="/target" class="dropzone"></form>

<script>
  Dropzone.options.myDropzone = {
    maxFilesize: 500,
    init: function() {
      this.on("uploadprogress", function(file, progress) {
        console.log("File progress", progress);
      });
    }
  }
</script>

If you can see the console output in regular intervals then the upload is working fine but just takes a while to finish.

这篇关于Dropzone.js - maxFilesize增加不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆