fine-uploader
fine-uploader copied to clipboard
dragging a large directory ignores `validation.itemLimit`
Type of issue
- [*] Bug report
If you drag a large directory into FIneUploader (say, the fine-uploader root, after installing node_modules) Fine Uploader adds them all to qq.UploadData as "submitting", even if the number of files is larger than itemLimit
I've monkey-patched this in my application code:
const _addFiles = this.uploader.addFiles.bind(this.uploader);
this.uploader.addFiles = function(data, params, endpoint) {
let uploads = self.uploader.getUploads(),
remove = self.itemLimit - (uploads.length + data.length);
if (remove) {
data = data.slice(0, remove);
}
return _addFiles(data, params, endpoint);
};
Have you looked into upstreaming this change into FineUploader?
How in depth would an appropriate pull request to fix this issue be?
For writing accompanying unit tests, test/unit/uploader.basic.api.js seems to use the Mocha unit test framework to ensure api functions set values correctly. It looks like tests have been implemented to either mock or use actual file uploads. What would be the preferred way to test limiting dropped files with these tools?