{"action":"created","issue":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/610","labels_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/610/labels{/name}","comments_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/610/comments","events_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/610/events","html_url":"https://github.com/danialfarid/ng-file-upload/issues/610","id":60295292,"number":610,"title":"POSTing as application/json instead of multipart","user":{"login":"baxford","id":914289,"avatar_url":"https://avatars.githubusercontent.com/u/914289?v=3","gravatar_id":"","url":"https://api.github.com/users/baxford","html_url":"https://github.com/baxford","followers_url":"https://api.github.com/users/baxford/followers","following_url":"https://api.github.com/users/baxford/following{/other_user}","gists_url":"https://api.github.com/users/baxford/gists{/gist_id}","starred_url":"https://api.github.com/users/baxford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baxford/subscriptions","organizations_url":"https://api.github.com/users/baxford/orgs","repos_url":"https://api.github.com/users/baxford/repos","events_url":"https://api.github.com/users/baxford/events{/privacy}","received_events_url":"https://api.github.com/users/baxford/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-09T03:52:35Z","updated_at":"2015-03-09T07:38:05Z","closed_at":null,"body":"Hi, first off thanks for a great plugin!\r\nI'm trying to POST to an API that accepts plan JSON (with the file itself encoded as Base64), similar to this directive:\r\nhttps://github.com/adonespitogo/angular-base64-upload, but I'd like to keep the features of your plugin, such as drag and drop, multiple files etc.\r\nI've managed to get things working by creating my own transformRequest function which returns the JSON object including the base64 encoded file, eg\r\n          transformRequest: function(data, headerGetter) {\r\n            var r = {image: base64String, fileName: fileName };\r\n            return JSON.stringify(r);\r\n          }\r\n\r\nHowever in angular-file-upload.js upload function (line 114), it also pushes a transformRequest function which returns a FormData object. This seems to force the POST to be a multipart POST.\r\n\r\nIs there a simple way to prevent this final transformRequest function from being added, so that it only uses my custom transformRequest function, or would it require modifications, or a flag in the config object?\r\nI can submit a pull request if this would help.\r\nthanks!"},"comment":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/comments/77811048","html_url":"https://github.com/danialfarid/ng-file-upload/issues/610#issuecomment-77811048","issue_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/610","id":77811048,"user":{"login":"baxford","id":914289,"avatar_url":"https://avatars.githubusercontent.com/u/914289?v=3","gravatar_id":"","url":"https://api.github.com/users/baxford","html_url":"https://github.com/baxford","followers_url":"https://api.github.com/users/baxford/followers","following_url":"https://api.github.com/users/baxford/following{/other_user}","gists_url":"https://api.github.com/users/baxford/gists{/gist_id}","starred_url":"https://api.github.com/users/baxford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baxford/subscriptions","organizations_url":"https://api.github.com/users/baxford/orgs","repos_url":"https://api.github.com/users/baxford/repos","events_url":"https://api.github.com/users/baxford/events{/privacy}","received_events_url":"https://api.github.com/users/baxford/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T07:38:05Z","updated_at":"2015-03-09T07:38:05Z","body":"ah, I missed that on reading the doco, but it works great, thanks!"}}