Re: Pylons equivalent of cherrypy's serve_file?

2008-06-26 Thread Chris
: Is there a Pylons equivalent of CherryPy's serve_file ? I'm trying to allow file download for files that are not in the 'public' directory In cherry py, it'd go something like this: from cherrypy.lib.static import serve_file class Root:   [EMAIL PROTECTED]    def download(self, name

Re: Pylons equivalent of cherrypy's serve_file?

2008-06-25 Thread Shannon -jj Behrens
On Tue, Jun 24, 2008 at 7:41 PM, Chris [EMAIL PROTECTED] wrote: Is there a Pylons equivalent of CherryPy's serve_file ? I'm trying to allow file download for files that are not in the 'public' directory In cherry py, it'd go something like this: from cherrypy.lib.static import serve_file

Re: Pylons equivalent of cherrypy's serve_file?

2008-06-24 Thread Jonathan Vanasco
disclaimer - i'm no authority on pylons. the stock error controller (automagically generated) handles the magic error pages it has this in there: def img(self, id): Serve Pylons' stock images return self._serve_file(os.path.join(media_path, 'img', id)) def style(self,

Re: Pylons equivalent of cherrypy's serve_file?

2008-06-24 Thread Garland, Ken R
This is from an older application that I did, might need to be looked over for 0.9.6.2 compatibility: def download(self, environ, start_response): if not request.environ.has_key('REMOTE_USER'): return redirect_to(controller = '/login/ldap') else: fapp =