google app engine - serving blobs from GAE blobstore in flask -


i'm trying serve big files saved in blobstore using flask.

for smaller files can do:

def download_blob(blob_key):     blob_info = blobstore.get(blob_key)     response = make_response(blob_info.open().read())     response.headers['content-type'] = blob_info.content_type     response.headers['content-disposition'] = 'attachment; filename="%s"' % blob_info.filename      return response 

but fails larger files. how can incorporate blobstoredownloadhandler flask app without resorting webapp2?

if don't care range-requests, can set header of 'x-appengine-blobkey' (or blobstore.blob_key_header safe) string-version of blob-key, along content type , disposition have it.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -