{"action":"created","issue":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10883","repository_url":"https://api.github.com/repos/civicrm/civicrm-core","labels_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10883/labels{/name}","comments_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10883/comments","events_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10883/events","html_url":"https://github.com/civicrm/civicrm-core/pull/10883","id":251637502,"number":10883,"title":"CRM-21086: Allow Inline Download of Files","user":{"login":"mickadoo","id":6374064,"avatar_url":"https://avatars1.githubusercontent.com/u/6374064?v=4","gravatar_id":"","url":"https://api.github.com/users/mickadoo","html_url":"https://github.com/mickadoo","followers_url":"https://api.github.com/users/mickadoo/followers","following_url":"https://api.github.com/users/mickadoo/following{/other_user}","gists_url":"https://api.github.com/users/mickadoo/gists{/gist_id}","starred_url":"https://api.github.com/users/mickadoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickadoo/subscriptions","organizations_url":"https://api.github.com/users/mickadoo/orgs","repos_url":"https://api.github.com/users/mickadoo/repos","events_url":"https://api.github.com/users/mickadoo/events{/privacy}","received_events_url":"https://api.github.com/users/mickadoo/received_events","type":"User","site_admin":false},"labels":[{"id":246037889,"url":"https://api.github.com/repos/civicrm/civicrm-core/labels/master","name":"master","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-21T12:00:57Z","updated_at":"2017-09-07T13:28:30Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/civicrm/civicrm-core/pulls/10883","html_url":"https://github.com/civicrm/civicrm-core/pull/10883","diff_url":"https://github.com/civicrm/civicrm-core/pull/10883.diff","patch_url":"https://github.com/civicrm/civicrm-core/pull/10883.patch"},"body":"Overview\r\n----------------------------------------\r\nUsing the `/civicrm/file` endpoint to access a file will always download them without giving the option to view in the browser. By adding a query parameter we can allow browsers to show the content inline, if it is supported.\r\n\r\nBefore\r\n----------------------------------------\r\nFiles served from `/civicrm/file` will always be downloaded.\r\n\r\n![anim](https://user-images.githubusercontent.com/6374064/30125335-08831094-9330-11e7-8fae-f3ebdc27bd3f.gif)\r\n\r\nAfter\r\n----------------------------------------\r\nFiles served from `/civicrm/file` with the query param download=0 will be shown inline in the browser, if the browser supports it.\r\n\r\nIn order to show how this worked I changed a line in [attachment.tpl](https://github.com/civicrm/civicrm-core/blob/master/templates/CRM/Form/attachment.tpl#L34)\r\n\r\n`<a target=\"_blank\" href=\"{$attVal.url}\">`\r\n\r\nto\r\n\r\n`<a target=\"_blank\" href=\"{$attVal.url}&download=0\">`\r\n\r\n![anim](https://user-images.githubusercontent.com/6374064/30125275-cdbea270-932f-11e7-8bdb-f37f81f766aa.gif)\r\n\r\n---\r\n\r\n * [CRM-21086: Allow Inline View of Files Instead of Download](https://issues.civicrm.org/jira/browse/CRM-21086)"},"comment":{"url":"https://api.github.com/repos/civicrm/civicrm-core/issues/comments/327799120","html_url":"https://github.com/civicrm/civicrm-core/pull/10883#issuecomment-327799120","issue_url":"https://api.github.com/repos/civicrm/civicrm-core/issues/10883","id":327799120,"user":{"login":"monishdeb","id":3735621,"avatar_url":"https://avatars3.githubusercontent.com/u/3735621?v=4","gravatar_id":"","url":"https://api.github.com/users/monishdeb","html_url":"https://github.com/monishdeb","followers_url":"https://api.github.com/users/monishdeb/followers","following_url":"https://api.github.com/users/monishdeb/following{/other_user}","gists_url":"https://api.github.com/users/monishdeb/gists{/gist_id}","starred_url":"https://api.github.com/users/monishdeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monishdeb/subscriptions","organizations_url":"https://api.github.com/users/monishdeb/orgs","repos_url":"https://api.github.com/users/monishdeb/repos","events_url":"https://api.github.com/users/monishdeb/events{/privacy}","received_events_url":"https://api.github.com/users/monishdeb/received_events","type":"User","site_admin":false},"created_at":"2017-09-07T13:28:30Z","updated_at":"2017-09-07T13:28:30Z","author_association":"OWNER","body":"Ahh right, thanks for the tip. Works fine. Trivial but a nice improvement :D "}}
{"actor":{"display_login":"monishdeb"}}