
problems sending binary data in cgi
Quote:
> Hi there,
> I'm trying to send binary data (e.g. gif file) to a web browser using
> the following code:
> f = File.open(gif_filename, "rb")
> content = f.read(filesize)
> f.close
> print "Content-type: image/gif\n\n"
> print content
> I'm using ruby for windows. I'm getting problems because every 0x0a
> will be converted to 0x0d 0x0a. Must I use another method to print
> binary data for output? I've found nothing in the ruby documentation.
perhaps
f.binmode
but i'm on unices so can't test this.
-a
--
====================================
| Ara Howard
| NOAA Forecast Systems Laboratory
| Information and Technology Services
| Data Systems Group
| R/FST 325 Broadway
| Boulder, CO 80305-3328
| Phone: 303-497-7238
| Fax: 303-497-7259
====================================