Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » assets download logout [kind of solved]

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

Page: 1
Go to End
Author Topic: 315 Views
  • esakrielaart
    Avatar
    Community Member
    54 Posts

    assets download logout [kind of solved] Link to this post

    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

  • esakrielaart
    Avatar
    Community Member
    54 Posts

    Re: assets download logout [kind of solved] Link to this post

    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

    315 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.