{"action":"created","issue":{"url":"https://api.github.com/repos/enyo/dropzone/issues/861","labels_url":"https://api.github.com/repos/enyo/dropzone/issues/861/labels{/name}","comments_url":"https://api.github.com/repos/enyo/dropzone/issues/861/comments","events_url":"https://api.github.com/repos/enyo/dropzone/issues/861/events","html_url":"https://github.com/enyo/dropzone/issues/861","id":58537486,"number":861,"title":"One message for multiple files with same error","user":{"login":"audreyaw","id":10556371,"avatar_url":"https://avatars.githubusercontent.com/u/10556371?v=3","gravatar_id":"","url":"https://api.github.com/users/audreyaw","html_url":"https://github.com/audreyaw","followers_url":"https://api.github.com/users/audreyaw/followers","following_url":"https://api.github.com/users/audreyaw/following{/other_user}","gists_url":"https://api.github.com/users/audreyaw/gists{/gist_id}","starred_url":"https://api.github.com/users/audreyaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/audreyaw/subscriptions","organizations_url":"https://api.github.com/users/audreyaw/orgs","repos_url":"https://api.github.com/users/audreyaw/repos","events_url":"https://api.github.com/users/audreyaw/events{/privacy}","received_events_url":"https://api.github.com/users/audreyaw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-02-23T03:01:43Z","updated_at":"2015-02-25T04:58:05Z","closed_at":null,"body":"Hi,\r\n\r\nI am building a web application using dropzone and am relatively new to this plugin. So far, I have successfully implemented the default error message, but there was a request to make the error message appear as one on the dropzone form.\r\n\r\nFor example, if there's a validation to display error when the files are more than 2MB and there are 3 files that have the same error, the message should be displayed in the form above the dropzone area as below:\r\n\r\n\"The following files:\r\nFile 1\r\nFile 2\r\nFile 3\r\nare larger than 2MiB.\"\r\n\r\nThe appearance of the message should be like this:\r\n![dropzone](https://cloud.githubusercontent.com/assets/10556371/6322194/052b4db2-bb42-11e4-8909-a724baa494cd.jpg)\r\n\r\nI have already handled it with the addedfile method, but it can only show one message per file. I know that it can be done using alert or pop ups, but the request specifically required the message to be shown in the dropzone form since the form is in a modal.\r\n\r\nThis is my code:\r\n\r\n' this.on('addedfile', function(file) {\r\n\t\t\t\t\t\tvar fileName = file.name;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (file.size > 2000000) {\r\n\t\t\t\t\t\t\tthis.removeFile(file);\r\n\t\t\t\t\t\t\t$('#inputError').text(fileName + \" is larger than 2MiB.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\nIs there a way to handle all files simultaneously so I can get all of the error files and display them in one message? Please kindly assist me with this issue. Thank you in advance."},"comment":{"url":"https://api.github.com/repos/enyo/dropzone/issues/comments/75905688","html_url":"https://github.com/enyo/dropzone/issues/861#issuecomment-75905688","issue_url":"https://api.github.com/repos/enyo/dropzone/issues/861","id":75905688,"user":{"login":"audreyaw","id":10556371,"avatar_url":"https://avatars.githubusercontent.com/u/10556371?v=3","gravatar_id":"","url":"https://api.github.com/users/audreyaw","html_url":"https://github.com/audreyaw","followers_url":"https://api.github.com/users/audreyaw/followers","following_url":"https://api.github.com/users/audreyaw/following{/other_user}","gists_url":"https://api.github.com/users/audreyaw/gists{/gist_id}","starred_url":"https://api.github.com/users/audreyaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/audreyaw/subscriptions","organizations_url":"https://api.github.com/users/audreyaw/orgs","repos_url":"https://api.github.com/users/audreyaw/repos","events_url":"https://api.github.com/users/audreyaw/events{/privacy}","received_events_url":"https://api.github.com/users/audreyaw/received_events","type":"User","site_admin":false},"created_at":"2015-02-25T04:58:05Z","updated_at":"2015-02-25T04:58:05Z","body":"Also, after I use multipleUpload, I always get an error when trying to upload the files.\r\n\r\nThis is the error that appears in the Spring console log:\r\nInvalid property 'file' of bean class [com.nfs.model.DDR]: Could not instantiate property type [org.springframework.web.multipart.MultipartFile] to auto-grow nested property path: java.lang.InstantiationException: org.springframework.web.multipart.MultipartFile\r\n\r\nI've followed the examples exactly like they are, so I'm not sure what I did wrong.\r\n\r\nHere's the full dropzone code:\r\n\r\n$(\"#formImportDDR\").dropzone({\r\n\t\t\t\tparamName: \"file\",\r\n\t\t\t\tautoProcessQueue: false,\r\n\t\t\t\taddRemoveLinks : true,\r\n\t\t\t\tmaxFilesize: 2,\r\n\t\t\t\tmaxFiles: 6,\r\n\t\t\t\tuploadMultiple: true,\r\n\t\t\t\tparallelUploads: 6,\r\n\t\t\t\tacceptedFiles: \".pdf,.xls,.xlsx\",\r\n\t\t\t\tdictDefaultMessage: '',\r\n\t\t\t\tdictResponseError: 'Error uploading file!',\r\n\t\t\t\tparams: {\r\n\t\t\t\t    },\r\n\t\t\t\tinit: function() {\r\n\t\t\t\t\tvar queuedFiles = this.getQueuedFiles();\r\n\t\t\t\t\tvar acceptedFiles = this.getAcceptedFiles();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.on('successmultiple', function(){\r\n\t\t\t\t\t\tvar rejectedFiles = this.getRejectedFiles();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (rejectedFiles.length == 0) {\r\n\t\t\t\t\t\t\t$('#formImportDDR').modal('hide');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.on('maxfilesreached', function() {\r\n\t\t\t\t\t\t$('.dropzone').removeClass('dz-clickable'); // remove cursor\r\n\t\t\t            $('.dropzone')[0].removeEventListener('click', this.listeners[1].events.click);\r\n\t\t\t        });\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.on(\"maxfilesexceeded\", function(file){\r\n\t\t\t\t\t\tthis.removeFile(file);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#inputError').text(\"You cannot upload more than 6 files.\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.dropzone').removeClass('dz-clickable'); // remove cursor\r\n\t\t\t            $('.dropzone')[0].removeEventListener('click', this.listeners[1].events.click);\r\n\t\t\t\t    });\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.on('removedfile', function(){\r\n\t\t\t\t\t\t$('.dropzone').addClass('dz-clickable'); //add cursor\r\n\t\t\t            $('.dropzone')[0].addEventListener('click', this.listeners[1].events.click);\r\n\t\t\t            $('#inputError').text(\" \");\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.on('addedfile', function(file) {\r\n\t\t\t\t\t\t$('#inputError').text(\" \");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar fileName = file.name;\r\n\r\n\t\t\t\t\t\tvar validExtensions = [\".pdf\", \".xls\", \".xlsx\"];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (fileName.length > 0) {\r\n\t\t\t                var blnValid = false;\r\n\t\t\t                for (var j = 0; j < validExtensions.length; j++) {\r\n\t\t\t                    var sCurExtension = validExtensions[j];\r\n\t\t\t                    if (fileName.substr(fileName.length - sCurExtension.length, sCurExtension.length).toLowerCase() == sCurExtension.toLowerCase()) {\r\n\t\t\t                        blnValid = true;\r\n\t\t\t                        break;\r\n\t\t\t                    }\r\n\t\t\t                }\r\n\r\n\t\t\t                if (!blnValid) {\r\n\t\t\t                \tthis.removeFile(file);\r\n\t\t\t                \t$('#inputError').text(fileName + \" is invalid. Allowed extensions are: \" + validExtensions.join(\", \"));\r\n\t\t\t                }\r\n\t\t\t            }\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (file.size > 2097152) {\r\n\t\t\t\t\t\t\tthis.removeFile(file);\r\n\t\t\t\t\t\t\t$('#inputError').text(fileName + \" is larger than 2MiB.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (i = 0, l = queuedFiles.length; i < l; i++) {\r\n\t\t\t\t\t\t\tif (file.name == queuedFiles[i].name){\r\n\t\t\t\t\t\t\t\tthis.removeFile(file);\r\n\t\t\t\t\t\t\t\t$('#inputError').text(file.name + \" already exists.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t/* this.on('complete', function(file){\r\n\t\t\t\t\t\tvar queuedFiles = this.getQueuedFiles();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (i = 0, l = queuedFiles.length; i < l; i++) {\r\n\t\t\t\t\t\t\tif (file.name == queuedFiles[i].name){\r\n\t\t\t\t\t\t\t\tthis.removeFile(file);\r\n\t\t\t\t\t\t\t\t$('#inputError').text(file.name + \" already exists.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}); */\r\n\t\t\t\t}\r\n\t\t\t});"}}