MediaView::render() fires a 404 if ... you guessed it--the file cannot be found.
I had some similar trouble a while back (see link below). I placed a die(debug($path)) line just before that check and eventually figured out the problem is that is_dir() can use a relative path and it was throwing things off. I'm sorry that I can't remember the details better than that but I solved the problem by setting path param like so: 'path' => APP.$result['ItemFile']['directory'].DS, Although, if your app is working locally, perhaps the problem is simply that apache doesn't have read permission on that directory. But start with debugging the path to be sure it what you expect. http://groups.google.com/group/cake-php/browse_thread/thread/0f648c149c67bdcd/ec1f52e6f593017a?lnk=raot&fwc=1 On Tue, Jul 28, 2009 at 10:37 AM, Stinkbug<justink...@gmail.com> wrote: > > I'm assuming this is an apache config problem, but I'm not sure what > could be causing it. Thought I'd just ask the community to see if > anyone knew what the problem might be. > > I'm using the Media view to download files and have the files > directory outside the webroot. I'm getting a 404 Page cannot be found > error when tring to download the file. It works in out test > envirnoment just fine, but when I move into production, I get this > error. Could it be an apache config problem, or an app problem? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---