1. Binary to stdout

Howdy all,

I'm programing some cgi on a linux box, trying to
send an image through a cgi script.  I got it to
work (by piping the file through cat). I was just
wondering if there wasn't an easier (more system
dependant) way to get a binary file into standard
out.

Thanks in advance,
E.Allen Soard

Bookmark the HyperMart Small Business Center. All the tools you need to
succeed!
http://www.hypermart.net/center/

new topic     » topic index » view message » categorize

2. Re: Binary to stdout

On Thu, 10 Aug 2000 15:57:11 -0700, Allen Soard <esp-
software at MAIL.HYPERMART.NET> wrote:

>Howdy all,
>I'm programing some cgi on a linux box, trying to
>send an image through a cgi script.  I got it to
>work (by piping the file through cat). I was just
>wondering if there wasn't an easier (more system
>dependant) way to get a binary file into standard

  Allen:

   Ever thought of using xpm files ?

   Which I think linux can display, you might look at how david

   is using them in the win32lib.

 Just a thought.

 Bernie

new topic     » goto parent     » topic index » view message » categorize

3. Re: Binary to stdout

Bernie,

Just tried it, good idea but browsers don't
understand it. What i'm actually trying to do is
code a counter in euphoria.  I got it working
using Jeff Fielding's Pipe library and just
kicking the output through 'cat' but that seems
clumsy to me and I was just wondering if there
was another way.

-E.Allen Soard

---- Begin Original Message ----
 From: Bernie <xotron at PCOM.NET>
Sent: Thu, 10 Aug 2000 19:48:13 -0400
To: EUPHORIA at LISTSERV.MUOHIO.EDU
Subject: Re: Binary to stdout

  Allen:

   Ever thought of using xpm files ?

   Which I think linux can display, you might
look at how david

   is using them in the win32lib.

 Just a thought.

 Bernie

---- End Original Message ----


Bookmark the HyperMart Small Business Center. All the tools you need to
succeed!
http://www.hypermart.net/center/

new topic     » goto parent     » topic index » view message » categorize

4. Re: Binary to stdout

On Thu, 10 Aug 2000, E.Allen Soard wrote:
> Bernie,
>
> Just tried it, good idea but browsers don't
> understand it. What i'm actually trying to do is
> code a counter in euphoria.  I got it working
> using Jeff Fielding's Pipe library and just
> kicking the output through 'cat' but that seems
> clumsy to me and I was just wondering if there
> was another way.

You can send an image to a browser, via STDOUT, if it has the proper mime
content headers to identify itself to the browser.
Without looking it up, I think it goes something like:

puts(1,"Content-type:  image/gif\n\n") -- must have two linefeeds.

change the gif to jpeg, if appropriate.

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

5. Re: Binary to stdout

Irv,

That was the first thing I tried. Because STDOUT
is opened as ascii "w" as opposed to "wb" it
doesn't send the data correctly. Ho-hum...I guess
I'll just have to do things the way I am (or
write a small .so/dll to write binary (is anyone
using a function called "write" may as well use
the 'c' function name.:-p))

later,
Allen

You can send an image to a browser, via STDOUT,
if it has the proper mime
content headers to identify itself to the
browser.
Without looking it up, I think it goes something
like:

puts(1,"Content-type:  image/gif\n\n") -- must
have two linefeeds.

change the gif to jpeg, if appropriate.

Regards,
Irv

---- End Original Message ----


Bookmark the HyperMart Small Business Center. All the tools you need to
succeed!
http://www.hypermart.net/center/

new topic     » goto parent     » topic index » view message » categorize

6. Re: Binary to stdout

Hello,

>Just tried it, good idea but browsers don't
>understand it. What i'm actually trying to do is
>code a counter in euphoria.  I got it working
>using Jeff Fielding's Pipe library and just
>kicking the output through 'cat' but that seems
>clumsy to me and I was just wondering if there
>was another way.
>
>-E.Allen Soard

I don't know much about cgi but couldn't you just
save the image on the server as a jpeg and have
the html point to it in a <img src> tag?
I think that's how other counters work.

later,
Lewis Townsend
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu