# Bug OP-9231 - Attachment whitelist feature not working with direct uploads enabled

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 11.4.1 |
| Observed in versions |  |
| Sprint | 11.4.1 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| 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: 11.4.0

### **Steps to reproduce:**

1.  Enable S3 attachments (and direct uploads (default))
2.  Configure attachment whitelist to allow text/csv
3.  Try uploading a CSV file

### **Actual Behavior**

You see an error that "application/binary" is not in the whitelist and can't upload the attachment.

### **Expected Behavior**

You should be able to upload the attachment.

**Notes**

The correct content type for attachments during direct uploads is only going to be detected afterwards during the `FinishDirectUploadJob` when the frontend request cycle has already finished.

Whitelisting aplication/binary as well would circumvent the whitelist for affected attachments types. Those are all files for which the browser/frontend doesn't provide the correct content type when performing the `prepare` request. It works correctly for .txt files and pictures but fails for .csv files for instance.
