{"action":"created","issue":{"url":"https://api.github.com/repos/octobercms/october/issues/2182","repository_url":"https://api.github.com/repos/octobercms/october","labels_url":"https://api.github.com/repos/octobercms/october/issues/2182/labels{/name}","comments_url":"https://api.github.com/repos/octobercms/october/issues/2182/comments","events_url":"https://api.github.com/repos/octobercms/october/issues/2182/events","html_url":"https://github.com/octobercms/october/issues/2182","id":164092111,"number":2182,"title":"AJAX Framework does not handle file downloads","user":{"login":"dudheit","id":5411942,"avatar_url":"https://avatars.githubusercontent.com/u/5411942?v=3","gravatar_id":"","url":"https://api.github.com/users/dudheit","html_url":"https://github.com/dudheit","followers_url":"https://api.github.com/users/dudheit/followers","following_url":"https://api.github.com/users/dudheit/following{/other_user}","gists_url":"https://api.github.com/users/dudheit/gists{/gist_id}","starred_url":"https://api.github.com/users/dudheit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dudheit/subscriptions","organizations_url":"https://api.github.com/users/dudheit/orgs","repos_url":"https://api.github.com/users/dudheit/repos","events_url":"https://api.github.com/users/dudheit/events{/privacy}","received_events_url":"https://api.github.com/users/dudheit/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-06T14:40:09Z","updated_at":"2016-07-07T07:30:31Z","closed_at":"2016-07-07T07:30:31Z","body":"##### Expected behavior\r\n\r\nIf you use ``return Response::download('file.txt');`` in an AJAX Controller method, the browser should download the file.\r\n\r\n##### Actual behavior\r\n\r\nNothing happens. No file will be downloaded.\r\n\r\n##### Reproduce steps\r\n\r\n1) Specify a controller method with Download response:\r\n\r\n     public function onAjaxDownloadTest()\r\n     {\r\n        return Response::download('path/to/file.txt');\r\n     }\r\n\r\n2) Start an backend AJAX call to the controller function, e.g. using a button \r\n\r\n    <button\r\n        data-request=\"onAjaxDownloadTest\"\r\n        data-stripe-load-indicator>\r\n            Download via AJAX\r\n    </button>\r\n\r\n##### October build\r\n\r\nOctober Build 347\r\n"},"comment":{"url":"https://api.github.com/repos/octobercms/october/issues/comments/231004072","html_url":"https://github.com/octobercms/october/issues/2182#issuecomment-231004072","issue_url":"https://api.github.com/repos/octobercms/october/issues/2182","id":231004072,"user":{"login":"daftspunk","id":1392869,"avatar_url":"https://avatars.githubusercontent.com/u/1392869?v=3","gravatar_id":"","url":"https://api.github.com/users/daftspunk","html_url":"https://github.com/daftspunk","followers_url":"https://api.github.com/users/daftspunk/followers","following_url":"https://api.github.com/users/daftspunk/following{/other_user}","gists_url":"https://api.github.com/users/daftspunk/gists{/gist_id}","starred_url":"https://api.github.com/users/daftspunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daftspunk/subscriptions","organizations_url":"https://api.github.com/users/daftspunk/orgs","repos_url":"https://api.github.com/users/daftspunk/repos","events_url":"https://api.github.com/users/daftspunk/events{/privacy}","received_events_url":"https://api.github.com/users/daftspunk/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T07:30:31Z","updated_at":"2016-07-07T07:30:31Z","body":"This is an issue addressed in #2003 -- it is awaiting peer review. Although the approach seems too dirty, it may not be accepted.\r\n\r\nTake a look at this code for an example on how to download a file from AJAX, simply redirect to a regular URL: https://github.com/octobercms/october/blob/43eb8c49467c44ba4822eb1b287e11dd63d21bff/modules/cms/controllers/Themes.php#L282-L302\r\n"}}
{"actor":{"display_login":"daftspunk"}}