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.

General Questions

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

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

assets download logout [kind of solved]


Reply

2 Posts   341 Views

Avatar
esakrielaart

13 April 2012 at 9:39pm (Last edited: 13 April 2012 9:39pm), Community Member, 56 Posts

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

14 April 2012 at 7:13am Community Member, 56 Posts

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: [url]http://www.silverstripe.org/dataobjectmanager-module-forum/show/15829[/url].

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