content-disposition in @expose

8 views
Skip to first unread message

percious

unread,
Jun 15, 2006, 4:00:36 PM6/15/06
to TurboGears
Do you know if there is a good way to set the content-disposition when
serving up a file using @expose?

Thanks!
CP

Sean De La Torre

unread,
Jun 15, 2006, 5:24:52 PM6/15/06
to turbo...@googlegroups.com
Put this line in the method that will return the file:

cherrypy.response.headerMap["Content-Disposition"] = "<some value>"

percious

unread,
Jun 16, 2006, 9:53:41 AM6/16/06
to TurboGears
Thanks! The final piece for our MM integration!

CP

Javier Rojas

unread,
Jun 16, 2006, 12:14:13 PM6/16/06
to turbo...@googlegroups.com
2006/6/15, Sean De La Torre <sdela...@gmail.com>:

> Put this line in the method that will return the file:
>
> cherrypy.response.headerMap["Content-Disposition"] = "<some value>"
>
I know the answer is quite lileky a NO, but, is this
"webserver-portable"? e.g., will I be able to use my app with
mod_python,

Kevin Dangoor

unread,
Jun 16, 2006, 5:07:23 PM6/16/06
to turbo...@googlegroups.com

unless the connector between cp and mod_python is broken, I'd guess
this would work.

fumanchu

unread,
Jun 16, 2006, 10:41:57 PM6/16/06
to TurboGears
It's demonstrated in CherryPy's tutorial 9, which is tested against
mod_python regularly. So my answer is "quite likely a YES". :) Other
HTTP servers and gateways are free to munge this header, of course.


Robert Brewer
System Architect
Amor Ministries
fuma...@amor.org

Reply all
Reply to author
Forward
0 new messages