{"action":"created","issue":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/688","labels_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/688/labels{/name}","comments_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/688/comments","events_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/688/events","html_url":"https://github.com/danialfarid/ng-file-upload/issues/688","id":70400080,"number":688,"title":"\"415 unsupported media type\" when uploading file","user":{"login":"dimitrilahaye","id":7722597,"avatar_url":"https://avatars.githubusercontent.com/u/7722597?v=3","gravatar_id":"","url":"https://api.github.com/users/dimitrilahaye","html_url":"https://github.com/dimitrilahaye","followers_url":"https://api.github.com/users/dimitrilahaye/followers","following_url":"https://api.github.com/users/dimitrilahaye/following{/other_user}","gists_url":"https://api.github.com/users/dimitrilahaye/gists{/gist_id}","starred_url":"https://api.github.com/users/dimitrilahaye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimitrilahaye/subscriptions","organizations_url":"https://api.github.com/users/dimitrilahaye/orgs","repos_url":"https://api.github.com/users/dimitrilahaye/repos","events_url":"https://api.github.com/users/dimitrilahaye/events{/privacy}","received_events_url":"https://api.github.com/users/dimitrilahaye/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-23T12:28:46Z","updated_at":"2015-04-23T18:24:25Z","closed_at":null,"body":"Hello there ! I've a 415 error code when I upload a file.\r\n\"415 unsupported media type\".\r\nHere's my code on my Controller.\r\nDo you have any idea ?\r\n\r\n```javascript\r\n\t\t$scope.$watch('files', function(files) {\r\n\t\t\t$scope.formUpload = false;\r\n\t\t\tif (files != null) {\r\n\t\t\t\tfor (var i = 0; i < files.length; i++) {\r\n\t\t\t\t\t$scope.errorMsg = null;\r\n\t\t\t\t\t(function(file) {\r\n\t\t\t\t\t\tuploadFileReprise(file);\r\n\t\t\t\t\t})(files[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t$scope.uploadPic = function(files) {\r\n\t\t\t$scope.formUpload = true;\r\n\t\t\tif (files != null) {\r\n\t\t\t\tuploadFileReprise(files[0]);\r\n\t\t\t}\r\n\t\t};\r\nfunction uploadFileReprise(file) {\r\n\t\t\t$scope.errorMsg = null;\r\n\t\t\tuploadUsing$http(file);\r\n\t\t};\r\n\r\n\t\tfunction uploadUsing$http(file) {\r\n\t\t\tfile.upload = $upload.http({\r\n\t\t\t\turl:/*my_url*/\r\n\t\t\t\tmethod: 'POST',\r\n\t\t\t\theaders: {\r\n\t\t\t\t\t'Content-Type': '*/*'\r\n\t\t\t\t},\r\n\t\t\t\tdata: file\r\n\t\t\t});\r\n```\r\n```html\r\n<fieldset><legend>Upload on form submit</legend>\r\n\t    \r\n\t    Profile Picture: <input type=\"file\" ng-file-select=\"\" ng-model=\"picFile\" name=\"file\" accept=\"*/*\" required=\"\">\r\n\t  \t<br>\r\n\t\t<button ng-click=\"uploadPic(picFile)\">Submit</button>\r\n\t    <img ng-show=\"picFile[0].dataUrl != null\" ng-src=\"{{picFile[0].dataUrl}}\" class=\"thumb\">\r\n\t\t<span class=\"progress\" ng-show=\"picFile[0].progress &gt;= 0\">\t\t\r\n\t\t\t<div style=\"width:{{picFile[0].progress}}%\" ng-bind=\"picFile[0].progress + '%'\" class=\"ng-binding\"></div>\r\n\t\t</span>\t\r\n\t\t<span ng-show=\"picFile[0].result\">Upload Successful</span>\r\n  \t</fieldset>\r\n```"},"comment":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/comments/95677259","html_url":"https://github.com/danialfarid/ng-file-upload/issues/688#issuecomment-95677259","issue_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/688","id":95677259,"user":{"login":"danialfarid","id":1676054,"avatar_url":"https://avatars.githubusercontent.com/u/1676054?v=3","gravatar_id":"","url":"https://api.github.com/users/danialfarid","html_url":"https://github.com/danialfarid","followers_url":"https://api.github.com/users/danialfarid/followers","following_url":"https://api.github.com/users/danialfarid/following{/other_user}","gists_url":"https://api.github.com/users/danialfarid/gists{/gist_id}","starred_url":"https://api.github.com/users/danialfarid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danialfarid/subscriptions","organizations_url":"https://api.github.com/users/danialfarid/orgs","repos_url":"https://api.github.com/users/danialfarid/repos","events_url":"https://api.github.com/users/danialfarid/events{/privacy}","received_events_url":"https://api.github.com/users/danialfarid/received_events","type":"User","site_admin":false},"created_at":"2015-04-23T18:24:25Z","updated_at":"2015-04-23T18:24:25Z","body":"Here is a sample: https://github.com/danialfarid/ng-file-upload/wiki/spring-mvc-example"}}