#2 - Apparently if the browser does not have the capability to load
the file in the browser, the session seems to be broken; though I'm
not sure why after re-authenticating it will work non-stop.  I've
changed my method to check the file extension, and if it's a PDF it
will load it in the browser, otherwise it will force a download.

I'm still puzzled by the first issue (and admittedly why the 2nd
problem is a problem).



On Dec 8, 6:09 pm, Dave <[email protected]> wrote:
> I don't think is_numeric returns true for boolean values
>
> On Tue, Dec 8, 2009 at 12:41 PM, BrendonKoz <[email protected]> wrote:
> > I'm having a bit of an awkward time with Media Views recently after
> > extending my site to use a controller I had built using it (Document
> > Controller).  I'm experiencing a couple things:
>
> > 1. Internet Explorer seems to not actually load the file if caching is
> > either set to false, or simply not set.
>
> > 2. It seems that randomly (I have yet to pinpoint and replicate this)
> > the Auth session will require re-authentication for the media file
> > that is being downloaded (not a forced download), even if a user just
> > logged in.  Once they re-authenticate for any Media View file, any
> > further media views seem to open just fine.
>
> > My controller's function to use the Media Views is below:
> > function download($path, $filename){
> >        $this->view = 'Media';
> >        $extension = $this->getExtension($this->here);
> >        $params = array(
> >                'id' => $filename.'.'.$extension,
> >                'cache' => 10,                  //10 seconds -- had issues
> > with no cache
> >                'download' => false,    //render in browser if possible
> >                'extension' => $extension,
> >                'path' => DS.'documents'.DS.$path.DS
> >        );
> >        $this->set($params);
> > }
>
> > Prior to these issues, I had the cache set to 15 minutes.  I tried to
> > change it to use no cache as users would look at an old file,
> > overwrite that file, and then check the new file to see if it was
> > successful - because of the cache set in the browser, they wouldn't
> > see the new file.  I'm not as concerned over fixing that problem as I
> > am with the two problems listed above.
>
> > Does anyone have any ideas?
>
> > I'm somewhat concerned with the following lines in cake/libs/view/
> > media.php @ line 186:
> > if(!is_numeric($cache)){
> >        $cache = strtotime($cache) - time();
> > }
>
> > If $cache is true, or even false, the cache will end up being
> > negative.  Was this intended?  Could this cause issues with IE?  I'm
> > still unsure where the re-authentication issues could be occurring.
> > (I'm running CakePHP 1.2.4.8284 according to cake/VERSION.txt - but
> > the source code from the example came from the Cake API -
> >http://api.cakephp.org/view_source/media-view/#l-186)
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<cake-php%[email protected]>For
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to