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

javascript - Fineuploader limit to a single file - Stack Overflow

programmeradmin4浏览0评论

I would like to limit the amount files that can be dropped in the bucket to just a single file. I discovered the validation directive and the itemLimit attribute. However, when I set that to 1, it really doesn't do anything. Here's the code that I use to create the instance of fine upload:

Thanks for the help!

                $(this).fineUploader({
                    request: {
                        endpoint: 'api/endpoint.php'
                    },
                    validation: {
                        itemLimit: 1
                    },
                    autoUpload: true,
                    text: {
                        uploadButton: 'DROP ASSET HERE',
                    },
                    debug: false
                })
                    .on('plete', function(event, id, fileName, response) {

                });

I would like to limit the amount files that can be dropped in the bucket to just a single file. I discovered the validation directive and the itemLimit attribute. However, when I set that to 1, it really doesn't do anything. Here's the code that I use to create the instance of fine upload:

Thanks for the help!

                $(this).fineUploader({
                    request: {
                        endpoint: 'api/endpoint.php'
                    },
                    validation: {
                        itemLimit: 1
                    },
                    autoUpload: true,
                    text: {
                        uploadButton: 'DROP ASSET HERE',
                    },
                    debug: false
                })
                    .on('plete', function(event, id, fileName, response) {

                });
Share Improve this question asked May 1, 2013 at 1:45 snuckysnucky 1791 silver badge12 bronze badges 2
  • Works fine for me. There is even a live demo of this on the homepage that works. You will need to provide some more information. – Ray Nicholus Commented May 1, 2013 at 2:10
  • 1 If this is not working for you, then you are likely using a version of Fine Uploader that predates this feature. – Ray Nicholus Commented May 1, 2013 at 12:57
Add a ment  | 

1 Answer 1

Reset to default 7

Add multiple: false, to the code, this will limit to a single file.

发布评论

评论列表(0)

  1. 暂无评论