4
4
4ebyanka2018-02-27 07:41:28
Flask
4ebyanka, 2018-02-27 07:41:28

How to upload a huge tar archive to a client via Flask?

I have MongoDB with GridFS from which I need to upload large arrays of files in a packed form (at least tar) via the web to Flask. How to make sure that, for example, no more than 100MB is kept in memory (there are no larger files in the database) and is issued as a tar or zip archive. I know that you can create the archive itself in memory and give it as a file object to Flask (send_file), but it’s not clear how to unload Files from the database and at the same time Flask gives it to the client. I know that there is such an implementation in Java (Zimbra mail server), it can send arbitrarily large archives immediately from the file system

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2018-02-27
@4ebyanka

https://github.com/allanlei/python-zipstream

D
Dmitry, 2018-02-27
@dmtrrr

https://en.wikipedia.org/wiki/Chunked_transfer_encoding

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question