5 messages in com.googlegroups.pylons-discussRe: Pylons equivalent of cherrypy's s...| From | Sent On | Attachments |
|---|---|---|
| Chris | 24 Jun 2008 19:40 | |
| Jonathan Vanasco | 24 Jun 2008 20:18 | |
| Garland, Ken R | 24 Jun 2008 20:36 | |
| Shannon -jj Behrens | 24 Jun 2008 23:15 | |
| Chris | 26 Jun 2008 19:32 |
| Subject: | Re: Pylons equivalent of cherrypy's serve_file?![]() |
|---|---|
| From: | Chris (life...@gmail.com) |
| Date: | 06/26/2008 07:32:26 PM |
| List: | com.googlegroups.pylons-discuss |
Thank you, the paste.fileapp was worked great.
I've not used the If-Modified-Since and If-Modified headers before.. I'll take a look and try to utilize them.
On Jun 25, 1:15 am, "Shannon -jj Behrens" <jji...@gmail.com> wrote:
On Tue, Jun 24, 2008 at 7:41 PM, Chris <life...@gmail.com> 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 class Root: @cherrypy.expose def download(self, name): return serve_file(os.path.join(download_dir, name), content_type='text/plain')
Many thanks.
You might need to think about browser caching. If-Modified-Since and If-Modified aren't that hard to do manually. I've done them before when I was generating JavaScript dynamically so that the browser wouldn't have to redownload the JavaScript on every page hit.
-jj
--
It's a walled garden, but the flowers sure are
lovely!http://jjinux.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to pylo...@googlegroups.com
To unsubscribe from this group, send email to
pylo...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---




