• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple file Download

 
Kumar Ala
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Is it possible to go for multiple file download from struts2..? Any help is appreciated.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No; that's not how HTTP works... nothing to do with Struts.
 
Kumar Ala
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK David... i understand that struts2 can't do anything for this multiple file downloading.
Is there any other way..?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, have a link for each file.

Or maybe you can supply more than half a sentence on what you are trying to accomplish?
 
Kumar Ala
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could create a ZIP file of all the files the user wants to download.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only other alternative I can think of is to initiate multiple downloads in invisible iframes.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about something like: http://java.sun.com/javase/6/docs/api/java/util/zip/package-summary.html

Eric
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic