Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Password protected downloads (i.e., secure assets)


Go to End


3 Posts   2963 Views

Avatar
HansR

Community Member, 141 Posts

3 January 2009 at 4:26pm

Edited: 03/01/2009 4:36pm

Is there any way to have files or a directory of files inside the assets directory that can only be downloaded after the user has logged in? I have seen one or two people asking this question, but no solutions so far.

A default Silverstripe install allows direct download of the files via the .htaccess configuration. My web host allows secure folders to be created, but how would the users and groups of the server be matched to Silverstripe's users/groups so that logging in gives access to those files? Having to log in via basic HTTP authentication would look ugly.

Hans

Avatar
Nivanka

Community Member, 400 Posts

12 January 2009 at 3:10am

this can be done by adding the download like to a protected page.

to do this create a new page, go to the access tab, change the

Who can view this page on my site?

to only logged in users.

Avatar
MarijnKampf

Community Member, 176 Posts

12 October 2009 at 8:45pm

Please note adding the download to a password protected page does *not*make the download secure. If someone would forward the URL of the download - or say a search engine indexes it anyone can download the file.

I haven't tested it yet, but http://www.silverstripe.org/installing-silverstripe/show/254742 seems to offer a solution.