On 8/9/07, Jose Figueras <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have one folder, outside of my Pylons app (p.e. '/var/myapp/
> public/'), to used like a public repository.
>
> This repository there must be accesed with URLs like 'http://
> mydomain.tld/download/myfile.ext'.
>
> What I must to do to enable download files from one external folder
> from my Pylons app?

I think you can jigger StaticURLParser like this, though I haven't
tried it.  At the bottom of middleware.py:

download_app = StaticURLParser("/var/myapp/public", "/download")
app = Cascade([download_app, static_app, javascripts_app, app])
return app

You may have to add or remove a slash before or after "/download".

One thing Quixote has that Pylons doesn't is a static resource fetcher
that acts as a controller method; i.e., it can be routed to inside the
application.  This makes it possible to do things like custom MIME
types, cache times, authorization, logging, etc,, on individual files
or subdirectories.  These aren't feasable unless you write your own
middleware (which is then divorced from the application environment).
  So far I haven't needed it but it's something that would be
generally useful.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to