[Catalyst] Image serving

Wade.Stuart at fallon.com Wade.Stuart at fallon.com
Tue Jan 31 18:29:57 CET 2006






> On 31. jan. 2006, at 14.23, Harold Frayman wrote:
>
> > Andreas Marienborg" <omega at palle.net> wrote:
> >> use the <base> html head tag?
> >>
> >> trough that you should be able to get it to reference relative urls
> >> from where you want
> >
> > I must be missing something obvious but critical; I can change the
> > base (via the template) or intercept the call (via Regex('img'))
> > and alter the path there.
> >
> > But I cannot work out what the path _should_ be, or alternatively
> > (additionally?), how to persuade Catalyst to process the image path
> > and return the image to the browser.
> >
> Do you have Static::Simple loaded as a plugin? if so, it should be a
> matter of referencing the file regularly.
>
> My thoughts was that if you have /Path/To/Documents/Path/Through/
> Tree/ in $c->req->base, you can perhaps add Title in the controller,
> put it in the stash and set that as base in the templates.
>
> Remember one thing: a url to catalyst doesnt necesarily make a path
> to a file. It has  no built in suppor for serving anything but stuff
> trough a view.
>
>

Or if you are hosting with mod_perl or whatever you can have the actual
root site be a normal docroot and put your app root as a subdir.  That way
you can reference the images with the same urls you used on the previous
non cat site.

-Wade




More information about the Catalyst mailing list