Thanks, will definitely order a PDF or your book when it's out.

Cheers,
Alli

On Jan 27, 11:56 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Tue, Jan 27, 2009 at 3:53 PM, Alli <allilis...@gmail.com> wrote:
>
> > Is it possible to make the extension a wild card somehow, e.g.
> > if i want jpg,png,gif,bmp ?
>
> LiftRules.dispatch.append {
>  case r @ Req("picture" :: fileName :: Nil, extension, GetRequest) if
> List("jpg", "png", "gif").contains(extension) => () =>
>     ...
>
> }
>
> Note that this is not a speed-optimal solution (you'd pre-populate set with
> the valid extensions).  But it demonstrates using extractors and guards...
> the stuff I'm writing about this very day in *Beginning Scala*.
>
> Thanks,
> David
>
>
>
>
>
> > On Jan 27, 11:50 pm, Alli <allilis...@gmail.com> wrote:
> > > Thanks chaps, can't believe i didn't spot it :).
>
> > > Cheers,
> > > Alfred
>
> > > On Jan 27, 11:48 pm, Tim Perrett <he...@timperrett.com> wrote:
>
> > > > Change the req to this:
>
> > > > Req("picture" :: fileName :: Nil, "jpg", GetRequest)
>
> > > > That should then work for you
>
> > > > Cheers, Tim
>
> > > > On Jan 27, 11:39 pm, Alli <allilis...@gmail.com> wrote:
>
> > > > > LiftRules.dispatch.append {
> > > > >   case r @ Req("picture" :: fileName :: Nil, "", GetRequest) => () =>
> > > > >      ...
>
> > > > > }
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning 
> Scalahttp://www.amazon.com/Beginning-Scala-David-Pollak/dp/1430219890/ref=...
> Follow me:http://twitter.com/dpp
> Git some:http://github.com/dpp
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to