<p>I would like to download asset files from Craft 3 dashboard.</p>

<p>Those files are out of web folder because of security reason.
I made "documents" folder just under the root of the project, and the files are in there.</p>

<p>However, the function of "download file" does not work, although "preview file" and "Edit image" works.
I think it is strange.</p>

<p>Do you have any idea to download the private files?</p>

CC BY-SA 4.0
2019-04-10T18:47:11.677Z
I doubt this will be possible without PHP. You'll need to serve the file on your own and let yii2 set the correct headers. But without php there won't be a way since you can't access the original file
Robin Schambach
CC BY-SA 4.0
2019-04-10T20:42:47.223Z
Hmm, I don't think you are right. Clearly Craft's built in "Preview
file" option can access my image, even though it's in a private folder.
And after inspecting the URL of my image in the Preview window, I can
see that it has a special "private" URL (e.g.
http://<host_name>/cpresources/42d9d924/file7.png?v=1554913720). So
clearly Craft has a way of serving this file, without me doing any
additional PHP.
Kota.M
CC BY-SA 4.0
2019-04-10T20:42:50.633Z
So why it doesn't use this link for its "Download file"
option too? Even better, if I copy and paste myself this private URL in
my browser, "voila" here is my fully functional download link! Of
course, we can't expect our clients to download the files this way. This
clearly looks like a Craft CMS bug.
Kota.M
CC BY-SA 4.0
2019-04-10T20:50:32.630Z
Please note: I said the original file. Everything in the cp resource folder are just temporary, often croped files. But yeah you can use those too if you like
Robin Schambach
<craft3><assets>
How to download private assets (without public URL) from dashboard
# How to download private assets (without public URL) from dashboard

(Asked by: username_0 on 2019-04-10)

I would like to download asset files from Craft 3 dashboard.

Those files are out of web folder because of security reason.
I made "documents" folder just under the root of the project, and the files are in there.

However, the function of "download file" does not work, although "preview file" and "Edit image" works.
I think it is strange.

Do you have any idea to download the private files?

**Tags:** craft3, assets
> **Comments:**
> **username_1**: I doubt this will be possible without PHP. You'll need to serve the file on your own and let yii2 set the correct headers. But without php there won't be a way since you can't access the original file  
> **username_0**: Hmm, I don't think you are right. Clearly Craft's built in "Preview file" option can access my image, even though it's in a private folder. And after inspecting the URL of my image in the Preview window, I can see that it has a special "private" URL (e.g. http://<host_name>/cpresources/42d9d924/file7.png?v=1554913720). So clearly Craft has a way of serving this file, without me doing any additional PHP.  
> **username_0**: So why it doesn't use this link for its "Download file" option too? Even better, if I copy and paste myself this private URL in my browser, "voila" here is my fully functional download link! Of course, we can't expect our clients to download the files this way. This clearly looks like a Craft CMS bug.  
> **username_1**: Please note: I said the original file. Everything in the cp resource folder are just temporary, often croped files. But yeah you can use those too if you like  

---

## 0 answers

