Solved

Download all files with one click

Posted on 2014-01-09
7
598 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
  • 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
How our DevOps Team Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JQuery to parse xml string and get element by id 4 38
Materializecss - Different Behaviors in Browser's 1 38
tomcat startup error 5 70
Fulfillment API php code sample 1 42
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to dynamically set the form action using jQuery.

825 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