How do I serve a large file using Pylons?
- by Chris R
I am writing a Pylons-based download gateway. The gateway's client will address files by ID:
/file_gw/download/1
Internally, the file itself is accessed via HTTP from an internal file server:
http://internal-srv/path/to/file_1.content
The files may be quite large, so I want to stream the content. I store metadata about the file in a StoredFile model object:
class StoredFile(Base):
id = Column(Integer, primary_key=True)
name = Column(String)
size = Column(Integer)
content_type = Column(String)
url = Column(String)
Given this, what's the best (ie: most architecturally-sound, performant, et al) way to write my file_gw controller?