Download Directory and Contents

Is it possible to persuade the Stream result to download an entire directory and it's contents? And if so, how? I've no problem getting it to download individual files, but I have a need to download a series of files that must be in a specific directory structure.

Answers


I don't think so.

Stream result allow you to download ONE content, with its MIME type, its name, etc.

This makes it impossible to work with a lot of files, with different names and content type.

What you can do is:

  1. Render in a JSP the list of files (in anchor tags for example), everyone targeting the Action that will download that single file;

  2. Call multiple Actions via scripting opening multiple pages (target="_blank") for every file you have (dangerous, annoying, almost useless...);

  3. Create a zip with Java in server side, containing all your files and directories, then output the zip with Stream result.

I think you may consider the third option.


Need Your Help

RCP Refresh using native hooks not working

eclipse eclipse-rcp rcp

I'm working on a RCP application and I want to set "Refresh using native hooks and polling" to true (Window->Preferences->General->Workspace). I've checked this option in the preferences of my app ...

Objective-C ARC vs. MRR: why the switch?

objective-c cocoa memory-management ios5 automatic-ref-counting

I am a new cocoa developer coming from a C#/Java background. I had been introduced to memory management patterns which objective-c language uses and I just find them very helpful for code-conscious

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.