Serving files with pyramid-1.3

59 views
Skip to first unread message

yorjo

unread,
Sep 21, 2012, 12:39:48 PM9/21/12
to pylons...@googlegroups.com
Hi,

With pyramid-1.2 and older, I was serving files with the paste.fileapp.FileApp object.
Now that pyramid-1.3 has drop paste, what is the correct way to serve files?

I had a route like this one:
config.add_route("tool.download", "/tool/download/{label}.tgz")

Linked to a view that return the file like this:
# build the result path from request params
...
return self._request.get_response(FileApp(result_path))

Best regards,

Jonathan

Michael Merickel

unread,
Sep 21, 2012, 12:44:36 PM9/21/12
to pylons...@googlegroups.com
http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/api/response.html#pyramid.response.FileResponse
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-devel" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pylons-devel/-/Z4mWgKE-RW4J.
> To post to this group, send email to pylons...@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-devel...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-devel?hl=en.
Reply all
Reply to author
Forward
0 new messages