aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Multiple file Download Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Multiple file Download" Watch "Multiple file Download" New topic
Author

Multiple file Download

Kumar Ala
Ranch Hand

Joined: Apr 30, 2009
Posts: 53
Hi All,
Is it possible to go for multiple file download from struts2..? Any help is appreciated.

kumar
SCEA5 P1
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No; that's not how HTTP works... nothing to do with Struts.
Kumar Ala
Ranch Hand

Joined: Apr 30, 2009
Posts: 53
OK David... i understand that struts2 can't do anything for this multiple file downloading.
Is there any other way..?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Not using a browser's download capability.

Moving to HTML/JavaScript, in case somebody else knows how this can be done.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56224
    
  13

Sure, have a link for each file.

Or maybe you can supply more than half a sentence on what you are trying to accomplish?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Kumar Ala
Ranch Hand

Joined: Apr 30, 2009
Posts: 53
Bear,

I am trying to donwload multiple files with single button click. (Can't use PHP or any .NET technologies)
In my case it doesn't work with having single link for each file. Client is not ready to click on each link to download files.

Let me know if you need any other information.

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35254
    
    7
You could create a ZIP file of all the files the user wants to download.


Android appsImageJ pluginsJava web charts
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 639
FileUpload from the Jakarta Commons package seems to handle multiple files. See http://commons.apache.org/fileupload/using.html

Edit: Oops This was about file download. Sorry.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
Kumar Ala wrote:Bear,

I am trying to donwload multiple files with single button click. (Can't use PHP or any .NET technologies)
In my case it doesn't work with having single link for each file. Client is not ready to click on each link to download files.

Let me know if you need any other information.

Thanks


As Ulf said zip file. There is another way, but the user will get a download prompt for every file. Doubt you want that.

Eric
Kumar Ala
Ranch Hand

Joined: Apr 30, 2009
Posts: 53
I Guess Ulf's solution might work for me here.
Yes Eric surely user don't want to click on each file to be downloaded.

Ulf can you let me know how we can achive this to download using Zip file...?
It is somethins like i will have list of files and user selectes some file from the list and tried to download. I don't know where i should handle this to zip and download.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56224
    
  13

The only other alternative I can think of is to initiate multiple downloads in invisible iframes.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
How about something like: http://java.sun.com/javase/6/docs/api/java/util/zip/package-summary.html

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
Bear Bibeault wrote:The only other alternative I can think of is to initiate multiple downloads in invisible iframes.


A suggested it but OP does not want multiple prompts so zip is only solution.

Eric
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Multiple file Download
 
Similar Threads
mutiple file download
How can I upload multiple files using html:file
how to read a file on server
Downloading Multiple Files
Struts 2 Multiple File Download