Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Django 中,我正在寻找一种同时提供多个不同文件的方法。我不能使用静态存档(.zip、.tar 等),因为我没有足够的存储空间来缓存这些文件,而且动态生成它们需要很长时间(每个都可能在 100兆字节)。
有没有一种方法可以向浏览器表明有几个文件正在出现?在将文件流式传输给用户之前,也许有一种容器格式可以指示?
编辑:每个包中可能有数百个文件,因此要求用户下载每个文件非常耗时。
啊,.tar 文件格式可以流式传输。我现在将对此进行试验。
http://docs.python.org/library/tarfile.html