2

我需要从服务器下载多个文件并将它们压缩到一个文件中。这样用户在下载时将只处理一个文件。

我们有文件托管在 akamai 服务器中,我们想在客户端下载这些文件,然后以编程方式压缩它们并弹出消息询问用户他们要将压缩文件保存在哪里。

4

2 回答 2

2

You contradict yourself. Initially you say that you want your users to deal with just 1 file while downloading. It means that files are ziped up on the server side and downloaded as one big zip files. This makes sense. User saves bandwidth and has to deal with just 1 file downloaded from your site. Plus all files are stored together as a package.

Then you say that you want to download all files separately and zip them up on the client side. This is a completely different requirement and to tell the truth it doesn't make sense to me. The files have already been downloaded. The bandwidth was already consumed. Why would you want to zip them now? You want to popup a message asking where to save this zip file? But the file has already been downloaded. What would you do if user cancels this dialog?

So, the first scenario can be implemented relatively easily. The second scenario (client-side) cannot be implemented with Javscript only. You can do it with an additional help of ActiveX but it will work in IE only.

于 2009-08-13T07:10:01.130 回答
0

我们可以使用 Adob​​e Flex 从服务器下载文件作为字节数组到客户端,可以压缩字节数组并将其保存到客户端机器。

于 2009-09-15T09:16:57.413 回答