Hi,

I am uploading files(images, mp3s etc) to my webroot /files/ folder.
The files are named "<their id number>.<their extension>". Without any
custom routing I can access these files by "/files/343.png".

I would like to access this file by using the URL "/files/343-
sometitle.png" as well. At the moment I can do this by using a custom
route and an action, but this just redirects and so the URL displays "/
files/343.png" - I would like the URL to not change and for the file
to be displayed as it would be normally.

Can this be done using just a route? I have tried variations of the
below custom route, but it would seem routes must have a controller/
action url.

Router::connect('/files/:id-:title.:ext', array('url' => '/
files/:id.:ext'),
array('id' => '[0-9]*', 'title' => '[a-zA-Z0-9\-_ ]*', 'ext' => '[a-zA-
Z0-9]*'));

Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to