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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

assets download logout [kind of solved]


Go to End


2 Posts   693 Views

Avatar
esakrielaart

Community Member, 59 Posts

13 April 2012 at 9:39pm

Edited: 13/04/2012 9:39pm

Hi,

I have (another) significant problem which I hope you can help me to figure it out. I have a local website which I created a secure assets folder by placing the following in the .htaccess in assets/Uploads/Secure:

<IfModule xsendfile_module>
XSendFile on 
</IfModule>
RemoveHandler .php .phtml .php3 .php4 .php5 .inc 
RemoveType .php .phtml .php3 .php4 .php5 .inc 
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteRule (.*) sapphire/main.php?url=%1&%{QUERY_STRING} [L]

Then, I also have a small class which handles the download of the requested file by using. Now I notice that local, this will work fine, but on my website, the user, even if logged in allready, keeps receiving a login screen after clicking a link like mysite.com/assets/Uploads/Secure/file.ext.

Is this a familiar problem? Maybe there is a default solution to this that I am not aware of?

Thanks in advance,
Maurice

Avatar
esakrielaart

Community Member, 59 Posts

14 April 2012 at 7:13am

Okay, it seemed to be a combination of errors. I found this post very useful, mainly the mention about setting a session save path, though I needed little different settings as I use another host: http://www.silverstripe.org/dataobjectmanager-module-forum/show/15829.

Also, I found I always have to set ?flush=1 to the end of the link to a secured file, for some reason, otherwise the error keeps throwing.

Hope someone else can also use this findings.

Yours sincerely,
Maurice