• 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

Binary Data in CSV Report

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
One of the data is in the binary format(img) and i need to generate the csv report,Hence the better approach would be to use servlets than JSP. Am i right?
regards
sudha
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, JSPs can't be used to generate binary content; you'll need to use servlets.

But CSV is a text format - it can't handle binary data either. Were you thinking of encoding your binary data so that it becomes ASCII, maybe using something like base-64?
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i dont know how to write the img data into the csv. From my understanding, i can write the image data in the csv if i use the base-64 format in the response object..let me try
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CSV is ill-suited to handle large data items like an ASCII-encoded image. A better way might be to store the image separately, and just put the name of the image file in the CSV, so that an application reading the CSV can find it. That way you wouldn't need to encode the image, too, thus making it usable as it is (which it wouldn't be if encoded).
reply
    Bookmark Topic Watch Topic
  • New Topic