This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide and have Khalid Mughal and Vasily Strelnikov on-line!
See this thread for details.
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

how to set the download mode

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

i m creating an application which queries the database and store the result in excel sheet on application server which runs under unix
operating system. i m providing link to download the excel sheet in jsp page. it is working, but the problem is that whenever it is
downloading the excel sheet it is in ascii mode because of which i m not getting file in excel sheet. is there any other way where i
can set download mode.

thnx in advance

regd
ritu
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your just providing a link to a file, the server should take care of this for you. You may need to add a mime type entry for a particular file. In Tomcat, the mime types are in the global web.xml (the one in the conf directory).

If you're streaming the file to them from a database or location outside of the sections of your app that are accessible to browsers, you'll need to set the content type and the content disposition headers.

I have an example application that streams images from a directory under WEB-INF. It should have enough code to get you going.
http://simple.souther.us Look for SimpleStream.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!
whatever reply has been given by

Ben Souther
ranch hand
Member # 88262
is correct one .and you also send all detail relative to file in header.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic