上传前客户端提取 zip 文件的选项

发布于 2024-11-16 21:16:32 字数 463 浏览 0 评论 0原文

我们的问题

我们正在构建一个基于浏览器的应用程序,允许用户将文件上传到服务器进行处理。服务器端是使用 Codeigniter v2.0.2 框架用 PHP 编写的。要上传的文件是另一个系统的输出,其格式不受我们控制。它们可能非常大(数百 MB),但服务器端处理不需要它们的大部分内容。这些文件本身实际上是 zip 格式(尽管带有定制扩展名),包含大量图像文件和相对较小的 XML 文件,这只是我们服务器端处理所需要的。显然,当我们需要的质量不到 1% 时,发送整个文件会非常浪费。我们也不希望用户手动从文件中提取 XML。

我的问题

我们可以选择哪些方式编写客户端代码来从 zip 中提取 XML 文件并将其发送?很高兴考虑在大多数现代浏览器中运行的任何技术。虽然我们是一家 C#/C++ 编码公司,但 Web 技术并不是我们的日常工作,因此非常感谢您收到代码示例!

非常感谢。

Our problem

We are building a browser based application that allows a user to upload files to a server for processing. The server side is written in PHP using the Codeigniter v2.0.2 framework. The files to be uploaded are the output of another system and their format is out of our control. They can be very large (100's of MB) but much of their content is not needed for the server side processing. The files themselves are actually zip format (albeit with a bespoke extension) and containing a lot of image files together with a relatively small XML file and it is only this we need for the server side processing. Obviously it would be pretty wasteful to send the entire file when we need less than 1% of it's mass. We also don't want to ask users to manually extract the XML from the file.

My question

What are our options for writing client side code that can extract the XML file from the zip and send it? Happy to consider any technologies that run in most modern browsers. Whilst we are a C#/C++ coding house, web technologies are not our day-to-day so code examples gratefully received!

Many thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

长亭外,古道边 2024-11-23 21:16:32

您是否正在寻找 zip 压缩库?您可以在客户端使用 SLSharpZipLib 及其 .NET 对应项 在服务器端。

Are you looking for a library for zip compression? You can use SLSharpZipLib on the client side and its .NET counterpart on the server side.

偷得浮生 2024-11-23 21:16:32

这应该可以通过签名的java小程序轻松实现,90%的用户将安装java,如果没有客户端可以安装它。

签名的 Java 小程序将能够访问该文件并提取您需要的文件并将其传输到您的服务器。

这也将非常快,因此即使是大文件也能正常工作。

This Should be easily doable with a signed java applet, 90% users will have java installed,if not client can install it.

Signed Java applet will be able to access the file and extract the file you need and transfer it to your server.

This will also be quite fast so even large files will work just fine.

萌吟 2024-11-23 21:16:32

我使用了 Phil Sturgeon 的 这个 库。我的文件不到 20mb,所以我无法判断它如何与您的项目配合使用。

I used this lib by Phil Sturgeon. My files were under 20mb so I can't tell how it will work with your project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文