# Can't download files using both API Docs and REST API

**URL:** https://community.dreamfactory.com/t/cant-download-files-using-both-api-docs-and-rest-api/2347
**Category:** Connecting to File Storage
**Created:** [March 10, 2016, 2:51pm UTC](https://community.dreamfactory.com/t/cant-download-files-using-both-api-docs-and-rest-api/2347 "2016-03-10T14:51:57Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![hedisam](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@hedisam](https://community.dreamfactory.com/u/hedisam)
#### Post date: [March 10, 2016, 2:51pm UTC](https://community.dreamfactory.com/t/cant-download-files-using-both-api-docs-and-rest-api/2347/1 "2016-03-10T14:51:57Z")

</div>

Hey,

I can’t download files from directories either using API Docs or the REST API.

Download from /api/v2/files/ is OK but from an inner directory, it gets error 404.

- download “/api/v2/files/photo.jpg” --\> response code: 200 OK

- download “/api/v2/files/test/photo.jpg” --\> response code: 404 NOT FOUND

---

<div class="post-metadata">

### Author: ![michaelnagy](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/michaelnagy/32/583_2.png) [@michaelnagy](https://community.dreamfactory.com/u/michaelnagy)
#### Post date: [March 11, 2016, 3:37am UTC](https://community.dreamfactory.com/t/cant-download-files-using-both-api-docs-and-rest-api/2347/2 "2016-03-11T03:37:51Z")

</div>

I’m getting the same problem here…tried to put the folder path in public paths in service configuration, still no success

---

<div class="post-metadata">

### Author: ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)
#### Post date: [March 11, 2016, 4:54pm UTC](https://community.dreamfactory.com/t/cant-download-files-using-both-api-docs-and-rest-api/2347/3 "2016-03-11T16:54:11Z")

</div>

I filed this as a bug yesterday. It looks like it only affects API Docs. Try making the call with another rest client, like Postman.  
If the call doesn’t work, please share your error information.

---

<div class="post-metadata">

### Author: ![michaelnagy](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/michaelnagy/32/583_2.png) [@michaelnagy](https://community.dreamfactory.com/u/michaelnagy)
#### Post date: [March 11, 2016, 11:22pm UTC](https://community.dreamfactory.com/t/cant-download-files-using-both-api-docs-and-rest-api/2347/4 "2016-03-11T23:22:18Z")

</div>

It doesn’t only affect API Docs, I can’t turn paths into public paths.

Config:

> **[Screenshot](https://prnt.sc/ae41st)**
>
> Captured with Lightshot

Postman return:

> **[Screenshot](https://prnt.sc/ae42k4)**
>
> Captured with Lightshot

---

<div class="post-metadata">

### Author: ![hedisam](https://avatars.discourse-cdn.com/v4/letter/h/b782af/32.png) [@hedisam](https://community.dreamfactory.com/u/hedisam)
#### Post date: [March 13, 2016, 6:19pm UTC](https://community.dreamfactory.com/t/cant-download-files-using-both-api-docs-and-rest-api/2347/5 "2016-03-13T18:19:58Z")

</div>

Actually Postman worked for me. As I can see in your screenshot it seems your Postman error is because of missing X-DreamFactory-Session-Token since you’ve provided only one header.

But still not working in API-Docs and REST API.

---

<div class="post-metadata">

### Author: ![michaelnagy](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/michaelnagy/32/583_2.png) [@michaelnagy](https://community.dreamfactory.com/u/michaelnagy)
#### Post date: [March 14, 2016, 3:04am UTC](https://community.dreamfactory.com/t/cant-download-files-using-both-api-docs-and-rest-api/2347/6 "2016-03-14T03:04:51Z")

</div>

I’m trying to set public paths to files, and public paths have to work without any headers. Even if I set a path as public in the file service config the path is not becoming public. Why is that?

Thanks

---

<div class="post-metadata">

### Author: ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)
#### Post date: [March 14, 2016, 12:21pm UTC](https://community.dreamfactory.com/t/cant-download-files-using-both-api-docs-and-rest-api/2347/7 "2016-03-14T12:21:09Z")

</div>

Public paths are for use in the browser, not for regular API calls. To access them them, you need to point your browser to

`http://yourdreamfactoryurl/files/publicfolder`

no api/v2
