# Unable to get files using nbi

**URL:** <https://forum.genieacs.com/t/unable-to-get-files-using-nbi/1307>\
**Category:** Uncategorized\
**Created:** [December 23, 2020, 8:55am UTC](https://forum.genieacs.com/t/unable-to-get-files-using-nbi/1307 "2020-12-23T08:55:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![harry3689](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/harry3689/32/345_2.png) [@harry3689](https://forum.genieacs.com/u/harry3689)\
**Post date:** [December 23, 2020, 8:55am UTC](https://forum.genieacs.com/t/unable-to-get-files-using-nbi/1307/1 "2020-12-23T08:55:16Z")

</div>

Hi all,

I’m using the latest GenieACS built from source. I’m using the nbi to get a list of files uploaded to GenieACS.

```
curl -i 'http://localhost:7557/files/'
HTTP/1.1 404 Not Found
GenieACS-Version: 1.2.3+20201222110936
Date: Wed, 23 Dec 2020 08:35:23 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

```

The rest of the api seems to be working fine though. Any clarifications would be much appreciated.

Best Regards,  
Harry

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [December 28, 2020, 8:24am UTC](https://forum.genieacs.com/t/unable-to-get-files-using-nbi/1307/2 "2020-12-28T08:24:15Z")

</div>

Try:

```auto
curl -i 'http://localhost:7557/fs.files/'

```

---

<div class="post-metadata">

**Author:** ![harry3689](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/harry3689/32/345_2.png) [@harry3689](https://forum.genieacs.com/u/harry3689)\
**Post date:** [December 28, 2020, 8:54am UTC](https://forum.genieacs.com/t/unable-to-get-files-using-nbi/1307/3 "2020-12-28T08:54:50Z")

</div>

Hi Zaid,

I tried out your suggestion, but the issue still persists.

```
curl -i 'http://localhost:7557/fs.files'
HTTP/1.1 404 Not Found
GenieACS-Version: 1.2.3+20201222110936
Date: Mon, 28 Dec 2020 08:50:09 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

404 Not Found

```

Regards,  
Harry

---

<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:** [February 8, 2021, 11:08am UTC](https://forum.genieacs.com/t/unable-to-get-files-using-nbi/1307/4 "2021-02-08T11:08:25Z")

</div>

Hi, I’ve hit the same problem on the latest version. Seems to be a bug, I’ve fixed it by modifying the regex to permit “.” character, in lib/nbi.

```auto
-const QUERY_REGEX = /^\/([a-zA-Z0-9_]+)\/?$/;
+const QUERY_REGEX = /^\/([a-zA-Z0-9_\.]+)\/?$/;

```

Although, it’s kind of an inconsistency … for GET you must use /fs.files/ but PUT&DELETE works with /files/. I’ll reply if I can find a better fix.

---

<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:** [February 8, 2021, 11:42am UTC](https://forum.genieacs.com/t/unable-to-get-files-using-nbi/1307/5 "2021-02-08T11:42:31Z")

</div>

not very elegant but it works.

```auto
+ if (collectionName === 'files') { collectionName = 'fs.files'; }
       const collection = collections[collectionName];

```

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [February 24, 2021, 12:52am UTC](https://forum.genieacs.com/t/unable-to-get-files-using-nbi/1307/6 "2021-02-24T00:52:36Z")

</div>

@lavira is right, this is a bug. Will publish a fix soon.
