• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Downloading a document.

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am developing a web site in which we have a button "Download" in a document, which downloads that document and stores on the clients machine. If anybody has done this earlier or anybody has idea about this please help me.
Thanks
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Well, if u want to download a document to the client machine u have to use multipart mime type. It takes a long time to explain all about that. The best thing you can do is go to http://www.servlets.com and from there just download com.oreilly.servlet package and in that package you can find MultipartResponse class. Just go through that class and check it out.
You can use this class with out knowing much about it, but as a developer i think it would be nice to go through the class and understand the functionality.
I hope this info will be useful to you.
Lok.
 
prasanth chiru
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi lokesh,
Thankyou very much for the immediate reply. I am just opening the site you have given. If I have any doubts further regarding this, I will contact you.
Thanks once again.
Manjunath
 
prasanth chiru
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi lokesh,
I have downloaded the code of oreilly and used it in my -program for downloading. The code is like this.
MultipartResponse multi = new MultipartResponse(res);
multi.startResponse("text/plain");
out.println("On your mark");
multi.endResponse();
try { Thread.sleep(1000); } catch (InterruptedException e) { }
multi.startResponse("text/plain");
out.println("Get set");
multi.endResponse();
multi.finish();
I am getting the dialog box asking for the options "want to open in the current locatio" or " save the content to disk". If I select a particular option, the class file of this progarm is getting downloaded. If I want to download a figure or some text, where should I mention it. Can you pleasea give me some program for that.
Thank You.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic