将zip文件从iOS应用流传输到Web浏览器 [英] Streaming a zip file from iOS app to web browser
问题描述
我的应用程序运行一个HTTP服务器,该服务器可以连接到同一Wifi网络上的桌面网络浏览器.目前,这可以处理对图像等的单独请求.
My app runs an HTTP server which can be connected to a desktop web browser on the same Wifi network. This currently handles individual requests for images etc.
我想找到一种传输多张图像的方法&一次性将文件保存到浏览器中.该大小太大,无法在发送之前在iPhone内存中构造.
I would like to find a way to transfer multiple images & files over to the browser in one go. The sizes would be too large to construct in iPhone memory before sending over.
我曾考虑过一次创建一个.zip文件并将其流式传输到其中,但不确定如何去做?
I've considered creating a .zip file and streaming files into it one at a time, but unsure how I could go about doing this?
推荐答案
创建ZIP文件非常简单.我只是自己做过另一件事(解压缩我下载的ZIP文件),但是大多数可用的库都支持压缩和解压缩.
Creating a ZIP file is fairly straightforward. I've only done it myself the other way around (decompression a ZIP file I've downloaded), but the majority of available libraries support both compression and decompression.
您可以使用较低级的C库之一,也可以使用各种人编写的几种Objective-C包装器之一.
You can either use one of the lower-level C libraries, or one of several Objective-C wrappers that various people have written.
我选择的个人包装是ZipKit: https://bitbucket.org/kolpanic/zipkit/Wiki/首页
My personal wrapper of choice is ZipKit: https://bitbucket.org/kolpanic/zipkit/wiki/Home
使用起来非常简单,因此它可能是您的最佳选择.
It is fairly straightforward to use, so it may be a good first port of call for you.
这篇关于将zip文件从iOS应用流传输到Web浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!