On 7/28/06, nate <[EMAIL PROTECTED]> wrote:
> You could always allow people to upload files to webroot (say
> 'page.html'), then access them as '/page', so when the request gets
> send to Cake, just have it read the file out of webroot. Otherwise,
> upload to some external directory, and apply some additional routing or
> controller logic when reading files. Just be careful you don't open a
> hole that allows people to indiscriminately access any file via the URL.
Let's say I use the routes approach. What would that route look like.
I have this:
$Route->connect('*.html', array('controller' => 'pages', 'action' =>
'view', 'firstparam'));
PagesController::view() reads the contents of the file from
webroot/files and sets that value in the view. I'm not sure the
syntax for the route if correct though for two reasons. I'm not sure
the URI mask is what it needs, and 'firstparam' is supposed to be the
name of the file, but that syntax seems odd. It's literally the only
thing I've managed to find that seems to address what I'm trying to
do, so I gave it whirl. The bottom line is, though, for whatever
reason, that's not working. I get the message:
The requested address index.html was not found on this server.
when I hit http://foo.com/index.html. Any pointers?
Thanks!
--
jason lee
http://www.steeplesoft.com
http://blogs.steeplesoft.com
http://littlezoper.livejournal.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---