I need to design a server side process which takes a request from a non-browser http client and based on the request params contacts a database to generate a data file approximately 1-5mb size and send back to client. I am thinking of a servlet, stateless session bean based solution but the generation time could vary from a few seconds to few minutes. We also need to encrypt the file and transmit to the client. Files needs to stored so that they can be reused. If somebody has done similar tasks, please share the details. What is the best way to serve a file? servlet or just sending the file url so that client could pull it from the webserver bypassing the servlet?
Thanks in advance.

As file generation is going to take long time (5 minutes) then waiting for response does not sound good. What about generating the file in background and sending an email to client with file URL, when done.
Thanks,
Vinod
http://blog.vinodsingh.com/

Thanks for you valuable responses.
Do you have any suggestion on encrypting these files (I need to encrypt the files at the server and the c++ client app running on users laptop downloads them via http) and key mangement? I might be able to get way with one set of keys for all clients.. symmetric vs asymmetric, specific implementations you could recomend. please share if you have any experience.
Thanks.

TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations technology projects - with its network of technology-specific websites, events and online magazines.