{"action":"opened","issue":{"url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/817","repository_url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput","labels_url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/817/labels{/name}","comments_url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/817/comments","events_url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/817/events","html_url":"https://github.com/kartik-v/bootstrap-fileinput/issues/817","id":196967724,"number":817,"title":"Help for filecustomerror, if possible.","user":{"login":"luizeduardots","id":24700568,"avatar_url":"https://avatars.githubusercontent.com/u/24700568?v=3","gravatar_id":"","url":"https://api.github.com/users/luizeduardots","html_url":"https://github.com/luizeduardots","followers_url":"https://api.github.com/users/luizeduardots/followers","following_url":"https://api.github.com/users/luizeduardots/following{/other_user}","gists_url":"https://api.github.com/users/luizeduardots/gists{/gist_id}","starred_url":"https://api.github.com/users/luizeduardots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luizeduardots/subscriptions","organizations_url":"https://api.github.com/users/luizeduardots/orgs","repos_url":"https://api.github.com/users/luizeduardots/repos","events_url":"https://api.github.com/users/luizeduardots/events{/privacy}","received_events_url":"https://api.github.com/users/luizeduardots/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-21T15:58:12Z","updated_at":"2016-12-21T15:58:12Z","closed_at":null,"body":"Good afternoon Krajee.\r\n\r\nAt first, congratulations for this amazing plugin. (and i´m sorry for bad english)\r\n\r\nWell, i´m trying do make use of filecustomerror on this situation.. on filepreupload function i do a search\r\non db verifying if there´s a number x of photos saved.\r\n\r\nIf yes, so i return a message to the user to choose which does he want delete\r\n\r\nI´ve tried to put some jquery code within the example from github but with no success.\r\nI´m also making use of codeigniter mvc framework.\r\n\r\nHere it is...\r\n\r\n$('#input-pt-br').on('filepreupload', function(event, data) {\r\n        $.ajax({\r\n            url : 'controller/method', \r\n            dataType : 'json',\r\n            type : 'post',\r\n            success : function(data){                \r\n                if(data === 'more than 5 photos'){\r\n                    return {\r\n                        message: 'You´re already on limit',\r\n                        data: {key1: 'Key 1', detail1: 'Detail 1'}\r\n                    };\r\n                }else{\r\n                    alert('erro');\r\n                }\r\n            }\r\n        });\r\n    });\r\n\r\n$(\"#input-pt-br\").on('filecustomerror', function(event, params, msg) {\r\n        //here goes 3 tries to show up the message\r\n        $('#retorno').html(params.data);\r\n        $('#retorno').html(msg);\r\n        alert(params.abortData);\r\n    });\r\n\r\n\r\nPlease Mr. Krajee, if you or any friend from github can help me, i´ll be very pleased.\r\nSince now, thanks.\r\n\r\n"}}
{"actor":{"display_login":"luizeduardots"}}