aspose file tools*
The moose likes Servlets and the fly likes creating in memory files and folders Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "creating in memory files and folders" Watch "creating in memory files and folders" New topic
Author

creating in memory files and folders

Ravikanth Reddy Bapathi
Greenhorn

Joined: Apr 13, 2007
Posts: 29
Hi,

My requirement is to create a set of xml files and folders and then download all of them as compressed attachment.
I have started with Download Servlet, i am able to get download dialog with the attachment in windows machine, but not in linux machine.
The reason for this being i have used the path as // and the folder name.

How can i make sure that this download servlet works in both windows and linux machines ?

is there a way that i create the folders and files in memory , zip them and download .

or how to create a folder and files from servlet in the web application context so that i can access them in both environments.

any help is appreciated.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


I have started with Download Servlet, i am able to get download dialog with the attachment in windows machine, but not in linux machine.
The reason for this being i have used the path as // and the folder name.

Not sure I follow this - if the problem is the folder name (and I'm maybe missing why this is the case) could you not just change it?


is there a way that i create the folders and files in memory , zip them and download

Yes. You could just create your zip folder in the Servlet container's temporary file space then stream the resulting file to the user.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ravikanth Reddy Bapathi
Greenhorn

Joined: Apr 13, 2007
Posts: 29
Hi Paul,

How is that i can create in servlet containers tmp space?
Could you please provide me more details on how to do the same?
 
wood burning stoves
 
subject: creating in memory files and folders