{"action":"created","issue":{"url":"https://api.github.com/repos/kernelsauce/turbo/issues/231","labels_url":"https://api.github.com/repos/kernelsauce/turbo/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/kernelsauce/turbo/issues/231/comments","events_url":"https://api.github.com/repos/kernelsauce/turbo/issues/231/events","html_url":"https://github.com/kernelsauce/turbo/issues/231","id":107330289,"number":231,"title":"StaticFileHandler","user":{"login":"markuman","id":3920157,"avatar_url":"https://avatars.githubusercontent.com/u/3920157?v=3","gravatar_id":"","url":"https://api.github.com/users/markuman","html_url":"https://github.com/markuman","followers_url":"https://api.github.com/users/markuman/followers","following_url":"https://api.github.com/users/markuman/following{/other_user}","gists_url":"https://api.github.com/users/markuman/gists{/gist_id}","starred_url":"https://api.github.com/users/markuman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markuman/subscriptions","organizations_url":"https://api.github.com/users/markuman/orgs","repos_url":"https://api.github.com/users/markuman/repos","events_url":"https://api.github.com/users/markuman/events{/privacy}","received_events_url":"https://api.github.com/users/markuman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-19T12:38:57Z","updated_at":"2015-09-20T07:15:50Z","closed_at":"2015-09-20T07:13:04Z","body":"This works fine. So `127.0.0.1:8000/download` will start transfering `file.zip`.\r\n\r\n    local app = turbo.web.Application(\r\n      {\r\n        {\"^/download$\", turbo.web.StaticFileHandler, \"file.zip\"},\r\n      })\r\n\r\nBut what when I don't want the static \"download\" address and want to start a transfer more dynamically.\r\n\r\nCurrently I'm doing\r\n\r\n    local f = assert(io.open(\"file.zip\", \"rb\")) -- read binary\r\n    local t = f:read(\"*all\")\r\n    f:close()  \r\n    self:write(t)\r\n\r\nBut this has a huge ram consumption when the transfering files are large. Any ideas how to handle this in a better way?"},"comment":{"url":"https://api.github.com/repos/kernelsauce/turbo/issues/comments/141755004","html_url":"https://github.com/kernelsauce/turbo/issues/231#issuecomment-141755004","issue_url":"https://api.github.com/repos/kernelsauce/turbo/issues/231","id":141755004,"user":{"login":"kernelsauce","id":1081754,"avatar_url":"https://avatars.githubusercontent.com/u/1081754?v=3","gravatar_id":"","url":"https://api.github.com/users/kernelsauce","html_url":"https://github.com/kernelsauce","followers_url":"https://api.github.com/users/kernelsauce/followers","following_url":"https://api.github.com/users/kernelsauce/following{/other_user}","gists_url":"https://api.github.com/users/kernelsauce/gists{/gist_id}","starred_url":"https://api.github.com/users/kernelsauce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kernelsauce/subscriptions","organizations_url":"https://api.github.com/users/kernelsauce/orgs","repos_url":"https://api.github.com/users/kernelsauce/repos","events_url":"https://api.github.com/users/kernelsauce/events{/privacy}","received_events_url":"https://api.github.com/users/kernelsauce/received_events","type":"User","site_admin":false},"created_at":"2015-09-20T07:15:50Z","updated_at":"2015-09-20T07:15:50Z","body":"Content length is required if you do not use chunked encoding as suggested.\nOtherwise your way works fine too.\nsøn. 20. sep. 2015 kl. 09.13 skrev Markus Bergholz <notifications@github.com\n>:\n\n> Closed #231 <https://github.com/kernelsauce/turbo/issues/231>.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/kernelsauce/turbo/issues/231#event-414098307>.\n>\n-- \nMvh / Best regards\nJohn Abrahamsen\nTlf/Phone: (+47) 941 35 009\n"}}