#NEWLINE# def file_serve( request , filename ) : #NEWLINE# #INDENT# blobinfo = blobstore . BlobInfo . all ( ) . filter ( 'filename =' , filename ) #NEWLINE# blobstore_key = blobinfo [ 0 ] . key ( ) . _BlobKey__blob_key #NEWLINE# blob_info = blobstore . BlobInfo . get ( blobstore_key ) #NEWLINE# filename = getattr ( blob_info , 'filename' , blobstore_key ) #NEWLINE# content_type = getattr ( blob_info , 'content_type' , 'application/octet-stream' ) #NEWLINE# response = HttpResponse ( content_type = content_type ) #NEWLINE# response [ BLOB_KEY_HEADER ] = blobstore_key #NEWLINE# response [ 'Content-Disposition' ] = smart_str ( ( 'attachment; filename=%s' % filename . split ( '/' ) [ ( - 1 ) ] ) ) #NEWLINE# return response