Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
58
rated 0 times [  65] [ 7]  / answers: 1 / hits: 183276  / 11 Years ago, mon, august 26, 2013, 12:00:00

So I have a httpd server running which has links to a bunch of files. Lets say the user selects three files from a file list to download and they're located at:



mysite.com/file1 
mysite.com/file2
mysite.com/file3


When they click the download button I want them to download these three files from the links above.



My download button looks something like:



var downloadButton = new Ext.Button({
text: Download,
handler: function(){
//download the three files here
}
});

More From » html

 Answers
54

The best way to do this is to have your files zipped and link to that:



The other solution can be found here: How to make a link open multiple pages when clicked



Which states the following:



HTML:



<a href=# class=yourlink>Download</a>


JS:



$('a.yourlink').click(function(e) {
e.preventDefault();
window.open('mysite.com/file1');
window.open('mysite.com/file2');
window.open('mysite.com/file3');
});


Having said this, I would still go with zipping the file, as this implementation requires JavaScript and can also sometimes be blocked as popups.


[#76116] Sunday, August 25, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brodyfrancisi

Total Points: 1
Total Questions: 102
Total Answers: 89

Location: Marshall Islands
Member since Mon, May 31, 2021
3 Years ago
brodyfrancisi questions
;