More on music/video file streaming

[edit|delete]

Something like this should do it:

def get_my_file():
    filename=request.args[0]
    path=os.path.join(request.folder,'uploads',filename)
    response.headers['ContentType'] ="application/octet-stream";
    response.headers['Content-Disposition']="attachment; filename=" +filename
    return response.stream(open(path),chunk_size=4096)


Post a comment