{"action":"created","issue":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/735","labels_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/735/labels{/name}","comments_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/735/comments","events_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/735/events","html_url":"https://github.com/danialfarid/ng-file-upload/issues/735","id":75626781,"number":735,"title":"how to create file for upload method from scope arraybuffer","user":{"login":"gswartz777","id":4447393,"avatar_url":"https://avatars.githubusercontent.com/u/4447393?v=3","gravatar_id":"","url":"https://api.github.com/users/gswartz777","html_url":"https://github.com/gswartz777","followers_url":"https://api.github.com/users/gswartz777/followers","following_url":"https://api.github.com/users/gswartz777/following{/other_user}","gists_url":"https://api.github.com/users/gswartz777/gists{/gist_id}","starred_url":"https://api.github.com/users/gswartz777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gswartz777/subscriptions","organizations_url":"https://api.github.com/users/gswartz777/orgs","repos_url":"https://api.github.com/users/gswartz777/repos","events_url":"https://api.github.com/users/gswartz777/events{/privacy}","received_events_url":"https://api.github.com/users/gswartz777/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-05-12T14:42:05Z","updated_at":"2015-05-12T22:04:55Z","closed_at":null,"body":"I am using this in an angular app to allow a user to select a local file to upload which in itself is simple enough.  However, we also have to offer the ability for the user to select a file from their google drive or dropbox.  I have this working where when the user selects a remote file from google or dropbox, it downloads the file and sets a scope arraybuffer to the contents of the downloaded file and also sets a scope filename property to the name of the file.  I am doing this on the fileSelected method of the ng-file-upload directive...\r\n\r\n    $scope.fileSelected = function (files) {\r\n        if (files && files.length) {\r\n            $scope.filename = files[0].name;\r\n            var reader = new FileReader();\r\n            reader.onload = function(e) {\r\n                $scope.fileArrayBuffer = reader.result;\r\n            }\r\n            reader.readAsArrayBuffer(files[0]);\r\n            $scope.$digest();\r\n        }\r\n    };\r\n\r\nSo, in all cases, when someone is done with the form and wants to submit it, I have a $scope.fileArrayBuffer property with the file contents and a $scope.filename property with the filename.  So, how can I do a final conversion to a file format for the Upload.upload method?  Thanks."},"comment":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/comments/101435973","html_url":"https://github.com/danialfarid/ng-file-upload/issues/735#issuecomment-101435973","issue_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/735","id":101435973,"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-05-12T22:04:55Z","updated_at":"2015-05-12T22:04:55Z","body":"Well looking at the request headers and payload it does send the file correctly. So what is not working? Do you receive the file on the server?"}}