-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mike C. Fletcher a écrit :
| If someone has a real solution, I'd love to hear about it. Note, having
| apache serve the files is *not* an option, as the content needs to be
| altered in some instances and I need (complex) authorization to
| determine if the file is going to be provided.
This is working fine for me on tg2.0:
~ @expose()
~ @allow_only(predicates.not_anonymous())
~ def serve_file(self, date=None, file=None):
~ import paste.fileapp
~ f =
paste.fileapp.FileApp('/usr/share/games/xmoto/Textures/Musics/speeditup.ogg',
~ **{'Content-Disposition': 'attachment; filename=' +
'test.ogg'})
~ from tg import use_wsgi_app
~ return use_wsgi_app(f)
Thanks,
- --
Jean-Denis Girard
SysNux Systèmes Linux en Polynésie française
http://www.sysnux.pf/ Tél: +689 50 10 40 / GSM: +689 79 75 27
-----BEGIN PGP SIGNATURE-----
iEYEARECAAYFAkrn52cACgkQuu7Rv+oOo/gw9ACgo06ItiOQpgyiv+dtmmc5n5qW
iQYAnRt3qikLgeHVR5m2zOXv+TwHJPlr
=isEM
-----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---