Function to create in-memory zip file and return as http response

前端 未结 2 1002
醉话见心
醉话见心 2020-12-06 07:39

I am avoiding the creation of files on disk, this is what I have got so far:

def get_zip(request):
    import zipfile, StringIO
    i = open(\'picture.jpg\',         


        
2条回答
  •  無奈伤痛
    2020-12-06 08:21

    Avoiding disk files can slow your server to a crawl, but it will certainly work.

    You'll exhaust memory if you serve too many of these requests concurrently.

提交回复
热议问题