Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3278

Dropupload can limit max uploading file count

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 8.5.2
    • 8.0.2
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.0.3 S7, ZK 8.0.3 S9, ZK 8.0.3 S10
    • None

      requirement spec

      Dropupload (or file upload) can provide an attribute "maxFileCount" to limit the maximal file count to upload.

      1. if the file number users try to upload (drop) exceeds the limitation, popup a warning message
      2. default value is no limitation
      3. users can customize the warning message

      psuedo code

      zk.afterLoad('zkmax.wgt', function() {
          var _origDropuploadImpl = {};
          zk.override(zkmax.wgt.Dropupload.prototype, _origDropuploadImpl, {
              _dropAction : function(event) {
          		event.stop();
                  if (event.originalEvent.dataTransfer.files.length > maxFileAllowed) {
                      jq.alert(msgzk.MESSAGE_FILE_OVER_LIMITATION, {icon:'ERROR'});
                      this.setVisible(false);
                      return;
                  }
                  _origDropuploadImpl._dropAction.apply(this, arguments)
              }
          });
      });   
      

            CharlesQiu CharlesQiu
            hawk hawk
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h