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   347 Views

Avatar
esakrielaart

Community Member, 56 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, 56 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: [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