Solved

Download all files with one click

Posted on 2014-01-09
7
609 Views
Last Modified: 2014-01-18
I have a button that allows me to download a file. the links come from a recordset which holds the path to the file and the names of the files.

Is there a way to download ALL files with one button ?   Instead of having multiple buttons one for each file ?

I am using classic ASP/VB
0
Comment
Question by:amucinobluedot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 250 total points
ID: 39769725
You would probably want to have the files zipped up first then download.  

If you are using file system object you can loop through and send the files one at a time but too many too fast may not be good.  Can you post the code you are using now?
0
 
LVL 33

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
ID: 39771237
it would be bad practice to even attempt to download multiple files at once, as this would be considered a security breach. Even if you have good intentions, this type of functionality would be considered malicious. I know if I went to a web page and clicked a link and multiple files started showing up on my hard drive, I'd be a little freaked out!

You have 2 options, either have them all zipped up in one file like Scott suggested, and have the user use 1 link, or have all of the files and have the user manually initiate each download.
0
 

Author Comment

by:amucinobluedot
ID: 39771395
Here is the scenario.

This is in a secure intranet. User uploads a copy of someone's birth certificate, a week later they upload a copy of their passport, a month later the driver's license and so on.
A year later they end up with say 15 documents, at this point they want to download all of them. They are not zipped because they were uploaded in the course of a full year and downloading one at the time takes a lot of time.
This is why they are asking me if there is a way to add an option to download all the documents in the person's file.
I have a recordset with the path to the folder were the files are stored and also a recordset with the file names (loops as they are multiple files).

I hope that clarifies why the options listed above are not feasible.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
ID: 39771425
with this scenario, I would just zip the files on the fly. Create a link on your page:

<a href="page.asp?files=all">get all files</a>

and use the following tutorial to learn how to zip the files up. I recommend the gzip option if you have access to install it on your server

http://www.4guysfromrolla.com/webtech/030800-1.shtml
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 250 total points
ID: 39771515
Another option is to store the items in your database.  First convert to base64 then encrypt.  Now those confidential items can't be viewed by accident by the wrong people as they are not a drive and you can generate whatever output you need on the fly.  But this would require a one time script to convert.  

If you don't have the classic asp components for this, I have just created what I needed as a webservice in php as a funciton.  Then post the php and output my base64, encrypted code back to my asp page.
0
 

Author Comment

by:amucinobluedot
ID: 39771882
Thanks. Storing the files in the database is not an option, its a 10 yr old system and all files are in a folder into which all new files are also uploaded.
We would need to zip on the fly as you mentioned so that then they can be downloaded.
I will look into that. And yes, I have a dedicated server with full access to install anything in it.
0
 

Author Closing Comment

by:amucinobluedot
ID: 39791362
NA
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question