{"action":"created","issue":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/933","labels_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/933/labels{/name}","comments_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/933/comments","events_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/933/events","html_url":"https://github.com/danialfarid/ng-file-upload/issues/933","id":100716775,"number":933,"title":"Upload adding header and footer?","user":{"login":"ThomasMldr","id":6631765,"avatar_url":"https://avatars.githubusercontent.com/u/6631765?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasMldr","html_url":"https://github.com/ThomasMldr","followers_url":"https://api.github.com/users/ThomasMldr/followers","following_url":"https://api.github.com/users/ThomasMldr/following{/other_user}","gists_url":"https://api.github.com/users/ThomasMldr/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasMldr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasMldr/subscriptions","organizations_url":"https://api.github.com/users/ThomasMldr/orgs","repos_url":"https://api.github.com/users/ThomasMldr/repos","events_url":"https://api.github.com/users/ThomasMldr/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasMldr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-13T08:50:18Z","updated_at":"2015-08-13T15:31:35Z","closed_at":null,"body":"When uploading files through your otherwise very useful library, I found all files where corrupt upon arrival.\r\nIt seems the library adds a header and footer on every upload to the binary stream, and I’m not sure why…\r\nI had to strip off the bytes in question in order to maintain the files intact. \r\nThis guy “Capt. Rochefort” wrote a very helpful blogpost on how to fix the problem: http://xombe.com/2014/06/05/angularjs-file-upload-corrupting-files/\r\n\r\nSo now my question is/are: \r\nDoes this “feature” have a use that I’m missing (which is entirely possible)? Or is it something you may have overlooked?\r\n\r\nAnyways, thanks for your useful library, and I’m looking forward to be enlightened!\r\n\r\nGreets, \r\nThomas Mulder\r\n"},"comment":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/comments/130730686","html_url":"https://github.com/danialfarid/ng-file-upload/issues/933#issuecomment-130730686","issue_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/933","id":130730686,"user":{"login":"ThomasMldr","id":6631765,"avatar_url":"https://avatars.githubusercontent.com/u/6631765?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasMldr","html_url":"https://github.com/ThomasMldr","followers_url":"https://api.github.com/users/ThomasMldr/followers","following_url":"https://api.github.com/users/ThomasMldr/following{/other_user}","gists_url":"https://api.github.com/users/ThomasMldr/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasMldr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasMldr/subscriptions","organizations_url":"https://api.github.com/users/ThomasMldr/orgs","repos_url":"https://api.github.com/users/ThomasMldr/repos","events_url":"https://api.github.com/users/ThomasMldr/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasMldr/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T15:31:35Z","updated_at":"2015-08-13T15:31:35Z","body":"I know, but I found the blogpost quite easily after experiencing the same problems...  And even though I'm fresh from school and have lots to learn, the author appears to know what he's doing, why else would he have a technical blog like that? \r\nBut it's entirely possible that I did something wrong, even though most of the code originates from the examples and jsfiddles found here..\r\n\r\nthis is the upload button: \r\n`<div class=\"btn\" ngf-select ng-model=\"file.new\">@IntranetResources.Generic_Upload</div>`\r\n\r\nand this the javascript in my controller\r\n```javascript\r\n$scope.uploadFile = function (file) {\r\n            Upload.upload({\r\n                url: \"/Umbraco/api/Documents/UploadFile?contentId=\" + $routeParams.id + \"&fileName=\" + file.name,\r\n                file: file\r\n            }).progress(function (evt) {\r\n                var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\r\n                console.log('progress: ' + progressPercentage + '% ' + evt.config.file.name);\r\n            }).success(function (data, status, headers, config) {...}\r\n```\r\n\r\nand this is the C# code on the API controller that receives the upload\r\n```c#\r\n[HttpPost]\r\n        public HttpResponseMessage UploadFile(int contentId, string fileName)\r\n        {\r\n            try\r\n            {\r\n                var stream = FixFileContent((StreamContent) Request.Content).Result; \r\n                //this is where I go to Capt. Rochefort's code to strip off the headers.. So something went wrong before this stage...\r\n...\r\n\r\n```\r\n\r\nLet me know if you miss anything! "}}