# GenieACS 1.2 uploading a file via NBI

**URL:** <https://forum.genieacs.com/t/genieacs-1-2-uploading-a-file-via-nbi/341>\
**Category:** Uncategorized\
**Created:** [October 10, 2019, 12:59pm UTC](https://forum.genieacs.com/t/genieacs-1-2-uploading-a-file-via-nbi/341 "2019-10-10T12:59:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lavira](https://avatars.discourse-cdn.com/v4/letter/l/87869e/32.png) [@lavira](https://forum.genieacs.com/u/lavira)\
**Post date:** [October 10, 2019, 12:59pm UTC](https://forum.genieacs.com/t/genieacs-1-2-uploading-a-file-via-nbi/341/1 "2019-10-10T12:59:08Z")

</div>

Hello,  
in the docs we have:  
_PUT /files/\<file\_name\>_  
_Upload a new file or overwrite an existing one. Returns status code 200 if the file has been added/updated successfully. The file content should be sent as the request body._

but if I try to update an existing file, I get an error:  
HTTP/1.1 500 Internal Server Error.  
MongoError: E11000 duplicate key error collection

I think this is a bug and the intended behavior is to overwrite the file in the database + updating metadata and maybe reply with a 200 OK, to distinguish between a file created and file updated (on new file it returns 201 Created).
