最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Dropzone.js - maxFilesize increase not working - Stack Overflow

programmeradmin0浏览0评论

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?

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?

Share Improve this question edited Nov 23, 2022 at 14:32 Sunderam Dubey 8,83712 gold badges24 silver badges41 bronze badges asked Jun 17, 2013 at 9:02 RonRon 23.5k33 gold badges112 silver badges214 bronze badges 7
  • is it possible your server doesn't allow that big of a file to be uploaded? or the post size is limited below that amount? – casraf Commented Jun 17, 2013 at 9:04
  • @Sybio: There is no code. I'm using this plugin - as stated :) – Ron Commented Jun 17, 2013 at 9:05
  • @ChenAsraf: When I use the Django Admin it works just fine. The problem seems to be with Dropzone.js – Ron Commented Jun 17, 2013 at 9:10
  • Why are you changing maxFilesize in .js file instead of plugin option while calling? – wakqasahmed Commented Jun 17, 2013 at 11:17
  • it doesn't matter, does it? my problem is that it's not working – Ron Commented Jun 17, 2013 at 12:43
 |  Show 2 more comments

4 Answers 4

Reset to default 19

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.

The Dropzone.options must be out of document.ready or it wont work.

Just for the record, because this post is from along time ago.

I solved it changing in the php.ini file parameter 'post_max_size' from my server. Maximum size of POST data that PHP will accept.

And then reboot the Apache Server.

Add to httpd.conf file:

<Directory "/tmp/">
    LimitRequestBody 256000
</Directory>

After, restart apache!

Reference: https://www.cyberciti.biz/faq/apache-limiting-upload-size/

发布评论

评论列表(0)

  1. 暂无评论