# Bug OP-5983 - New API-backed attachments always use content disposition attachment

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-5983

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 9.0.3 |
| Observed in versions | 9.0.0 |
| Sprint | 9.0.3 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 9.0.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### **Environment**:

Your OpenProject Version: 9.0.2

### **Steps to reproduce:**

1.  Open picture attachment in new tab

### **Actual Behavior**

The picture is downloaded.

### **Expected Behavior**

The picture is shown in the browser.

Pictures and, presumably, plain text files used to be served by the attachments controller with the content disposition `attachment.content_disposition` which would be `image/png` for instance. This way pictures could be opened in the browser directly which is more user friendly than always downloading them.

This has to be fixed [here](https://github.com/opf/openproject/blob/dev/lib/api/helpers/attachment_renderer.rb#L46). The issue was introduced with [this fix](https://github.com/opf/openproject/pull/7390) of another issue.

Note that this will require some extra logic for S3-backed attachments.  
The download link URL will have to be amended with the content disposition parameter so that S3 will serve the files accordingly.
