{"action":"created","issue":{"url":"https://api.github.com/repos/fex-team/webuploader/issues/136","repository_url":"https://api.github.com/repos/fex-team/webuploader","labels_url":"https://api.github.com/repos/fex-team/webuploader/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/fex-team/webuploader/issues/136/comments","events_url":"https://api.github.com/repos/fex-team/webuploader/issues/136/events","html_url":"https://github.com/fex-team/webuploader/issues/136","id":30763684,"number":136,"title":"如何判断文件是否上传成功？","user":{"login":"2betop","id":2698393,"avatar_url":"https://avatars.githubusercontent.com/u/2698393?v=3","gravatar_id":"","url":"https://api.github.com/users/2betop","html_url":"https://github.com/2betop","followers_url":"https://api.github.com/users/2betop/followers","following_url":"https://api.github.com/users/2betop/following{/other_user}","gists_url":"https://api.github.com/users/2betop/gists{/gist_id}","starred_url":"https://api.github.com/users/2betop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2betop/subscriptions","organizations_url":"https://api.github.com/users/2betop/orgs","repos_url":"https://api.github.com/users/2betop/repos","events_url":"https://api.github.com/users/2betop/events{/privacy}","received_events_url":"https://api.github.com/users/2betop/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fex-team/webuploader/labels/faq","name":"faq","color":"006b75"},{"url":"https://api.github.com/repos/fex-team/webuploader/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2014-04-03T10:33:10Z","updated_at":"2016-03-18T08:56:40Z","closed_at":null,"body":"默认如果啥也不处理，只要有返回数据就认为是成功，就算返回的是错误信息，也认为是成功了。\r\n\r\n但是，在认为成功前会派送一个事件`uploadAccept`，这个事件是用来询问是否上传成功的。在这个事件中你可以拿到上传的是哪个文件，以及对应的服务端返回`reponse`。\r\n\r\n```javascript\r\nuploader.on( 'uploadAccept', function( file, response ) {\r\n    if ( hasError ) {\r\n        // 通过return false来告诉组件，此文件上传有错。\r\n        return false;\r\n    }\r\n});\r\n```\r\n\r\n`response`是个对象，如果服务器返回是json格式，那么正和你意，都已经解析好了，如果不是json格式，`response._raw`里面可以拿到原始数据。所以，webuploader对于后端返回的数据格式是没有要求的。"},"comment":{"url":"https://api.github.com/repos/fex-team/webuploader/issues/comments/198263597","html_url":"https://github.com/fex-team/webuploader/issues/136#issuecomment-198263597","issue_url":"https://api.github.com/repos/fex-team/webuploader/issues/136","id":198263597,"user":{"login":"TclComupter","id":17734071,"avatar_url":"https://avatars.githubusercontent.com/u/17734071?v=3","gravatar_id":"","url":"https://api.github.com/users/TclComupter","html_url":"https://github.com/TclComupter","followers_url":"https://api.github.com/users/TclComupter/followers","following_url":"https://api.github.com/users/TclComupter/following{/other_user}","gists_url":"https://api.github.com/users/TclComupter/gists{/gist_id}","starred_url":"https://api.github.com/users/TclComupter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TclComupter/subscriptions","organizations_url":"https://api.github.com/users/TclComupter/orgs","repos_url":"https://api.github.com/users/TclComupter/repos","events_url":"https://api.github.com/users/TclComupter/events{/privacy}","received_events_url":"https://api.github.com/users/TclComupter/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T08:56:40Z","updated_at":"2016-03-18T08:56:40Z","body":"您好，我安装上面写的  return false ，不会触发uploadError事件，是为什么？"}}