下载从远程服务器上的多个文件与单个用户确认 [英] Download multiple files from remote server with a single user confirmation

查看:165
本文介绍了下载从远程服务器上的多个文件与单个用户确认的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含图片的URL列表(可以多则1000项),一个网页,我想能够为用户一键点击下载的所有文件到本地硬盘驱动器。

I have a web page containing a list of pictures urls (can be more then 1000 items) and I want to enable a button for the user to click and download all of the files to the local hard drive.

下载过程应该要求用户提供一个目录来保存文件,然后继续前进,所有文件下载到该目录(如果可能的话,内创建子目录)。这应该与单个用户确认为整个下载过程来完成,并避免显示浏览器保存对话框每个文件。

The download process should ask the user for a directory to save the files in and then go ahead and download all files to that directory (if possible, creating sub directories inside). This should be done with a single user confirmation for the whole download process and avoid display the browser save dialog for each file.

有没有办法这样做?我知道我不能使用标准的HTTP协议进行下载,并有写一些控制来完成这项工作。该页面是用asp.net。

Is there a way doing that? I am aware I can't use the standard HTTP protocol for the downloads and have to write some kind of control to do the job. The page is written in asp.net.

下载到服务器,包装和发送给用户是不可能的。下载,必须源于客户机。

Downloading to the server, packing and sending to the user is not possible. The download has to be originated from the client machine.

推荐答案

您应该更新你的问题,包括从您的评论的要求,因为他们产生巨大的变化。如果服务器无法检索文件,因为他没有正确的权限,你唯一的选择就是运行在客户端的code。有几个选项如何做到这一点,主要取决于客户和您的编码技巧:

You should update your question to include the requirements from your comment, because they make a huge difference. If the server cannot retrieve the files, because he doesn't have the right permissions, your only option is to run the code on the client side. There are several options how to do this, mostly depending on the clients and your coding skill:


  1. 闪存(不知道写入本地文件系统的安全性方面,虽然)

  2. 的Java Webstart的(缺点:客户端需要安装Java运行时)

  3. 浏览器插件/扩展(缺点:只能支持浏览器的一个子集,该网页将不能立即使用,因为插件或扩展需要先安装)

在所有的情况下,你将不得不写的一个工具,检索您的服务器的URL列表,并开始下载。

In all cases, you will have to write a tool, that retrieves the URL list from your server and starts downloading it.

这篇关于下载从远程服务器上的多个文件与单个用户确认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆