# Bug NEX-214 - trying to upload forbidden files to NC using direct-upload results in a 500 error

Project: Stream Nextcloud app "OpenProject Integration"
Status: closed
URL: https://community.openproject.org/work_packages/NEX-214

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | Nextcloud Integration 2.3.0 |
| Observed in versions |  |
| Bug found in version (deprecated) |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

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

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1.  create a file called `.htaccess`
2.  get a direct upload token: ``` TOKEN=`curl -u admin:admin http://localhost/nextcloud-server/index.php/apps/integration_openproject/direct-upload-token -d '{"folder_id":2}' -H'Content-Type: application/json' | jq .token -r`` ```
3.  use the token to upload the `.htaccess` file `curl -XPOST 'http://localhost/nextcloud-server/index.php/apps/integration_openproject/direct-upload/'$TOKEN --form 'file=@"/tmp/.htaccess"' --form 'overwrite="true"' -H'Content-Type: multipart/form-data' -v`

### What is the buggy behavior?

_Please describe the bug with as most details as possible. Example:_

*   HTTP response code is 500

### What is the expected behavior?

_Describe how the application should behave like. Example:_

1.  HTTP response code 403
