开发者

Download multiple files from remote server with a single user confirmation

开发者 https://www.devze.com 2023-04-05 10:31 出处:网络
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.

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.

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.


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. Flash (Not sure about the security aspect of writing to the local file system, though)
  2. Java Webstart (Disadvantage: Clients need to have the Java runtime installed)
  3. Browser plugin/extension (Disadvantage: You can only support a subset of browsers and the page will not be immediately usable, as the plugin or extension needs to be installed first)

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

0

精彩评论

暂无评论...
验证码 换一张
取 消