{"action":"created","issue":{"url":"https://api.github.com/repos/eggjs/egg/issues/1178","repository_url":"https://api.github.com/repos/eggjs/egg","labels_url":"https://api.github.com/repos/eggjs/egg/issues/1178/labels{/name}","comments_url":"https://api.github.com/repos/eggjs/egg/issues/1178/comments","events_url":"https://api.github.com/repos/eggjs/egg/issues/1178/events","html_url":"https://github.com/eggjs/egg/issues/1178","id":241914570,"number":1178,"title":"ctx.getFileStream()获取文件流出错","user":{"login":"michaelouyang777","id":18063861,"avatar_url":"https://avatars2.githubusercontent.com/u/18063861?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelouyang777","html_url":"https://github.com/michaelouyang777","followers_url":"https://api.github.com/users/michaelouyang777/followers","following_url":"https://api.github.com/users/michaelouyang777/following{/other_user}","gists_url":"https://api.github.com/users/michaelouyang777/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelouyang777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelouyang777/subscriptions","organizations_url":"https://api.github.com/users/michaelouyang777/orgs","repos_url":"https://api.github.com/users/michaelouyang777/repos","events_url":"https://api.github.com/users/michaelouyang777/events{/privacy}","received_events_url":"https://api.github.com/users/michaelouyang777/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-11T03:31:40Z","updated_at":"2017-07-11T04:54:24Z","closed_at":null,"body":"目前我想上传一个文件到egg的服务器上，使用了FormData对象，包裹了一个blob（这个不是通过input type=“file”获取而来）\r\nconst formData = new FormData();\r\nformData.append(fileName, blob);\r\n这个blob对象，是通过FileReader的方法readAsArrayBuffer读取文件的二进制形式。\r\nconst reader = new FileReader();\r\nreader.readAsArrayBuffer(file);\t\r\nreader.onload = function (res) {\r\n      var buf = new Uint8Array(this.result);\r\n      console.info(buf); //[228, 184, 173, 230, 150, 135, 229, 173, 151, 231, 172, 166, 228, 184, 178]...\r\n      var blob = new Blob([buf]);\r\n}\r\n使用post请求，发送formData 给egg服务器，egg使用`ctx.getFileStream()`获取文件流，出现了Invalid filename: blob这个错误，这是什么原因？\r\n请问还有其他方法获取上传的文件流吗？\r\n"},"comment":{"url":"https://api.github.com/repos/eggjs/egg/issues/comments/314322709","html_url":"https://github.com/eggjs/egg/issues/1178#issuecomment-314322709","issue_url":"https://api.github.com/repos/eggjs/egg/issues/1178","id":314322709,"user":{"login":"michaelouyang777","id":18063861,"avatar_url":"https://avatars2.githubusercontent.com/u/18063861?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelouyang777","html_url":"https://github.com/michaelouyang777","followers_url":"https://api.github.com/users/michaelouyang777/followers","following_url":"https://api.github.com/users/michaelouyang777/following{/other_user}","gists_url":"https://api.github.com/users/michaelouyang777/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelouyang777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelouyang777/subscriptions","organizations_url":"https://api.github.com/users/michaelouyang777/orgs","repos_url":"https://api.github.com/users/michaelouyang777/repos","events_url":"https://api.github.com/users/michaelouyang777/events{/privacy}","received_events_url":"https://api.github.com/users/michaelouyang777/received_events","type":"User","site_admin":false},"created_at":"2017-07-11T04:54:24Z","updated_at":"2017-07-11T04:54:24Z","body":"@popomore 这个例子是使用input type=\"file\"获取到文件，以form表单的形式提交到后台。\r\n这个方法可以实现，但是现在我使用移动端，不采用这种方式获取到文件。"}}
{"actor":{"display_login":"michaelouyang777"}}