1. CGI OUTPUT

This is a multi-part message in MIME format.

------=_NextPart_000_000B_01C2E8B9.98C5F860
	charset="iso-8859-1"

How do you send binary outut using euphoria as cgi, becuase when I just =
do puts(1,"Something Binary"&10) it prints out 'Something Binary'&10&13 =
and when sending a picture like a jpeg that messes it up, I'm Using =
Apache 1 on win98se

------=_NextPart_000_000B_01C2E8B9.98C5F860
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4807.2300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>How do you send binary outut using =
euphoria as cgi,=20
becuase when I just do puts(1,"Something Binary"&amp;10) it prints out=20
'Something Binary'&amp;10&amp;13 and when sending a picture like a jpeg =
that=20

------=_NextPart_000_000B_01C2E8B9.98C5F860--

new topic     » topic index » view message » categorize

2. Re: CGI OUTPUT

xerox_irs at lvcm.com wrote:

> How do you send binary outut using euphoria as cgi, becuase when I
> just do puts(1,"Something Binary"&10) it prints out 'Something
> Binary'&10&13 and when sending a picture like a jpeg that messes it
> up, I'm Using Apache 1 on win98se

IIRC, you need to send the MIME type of whatever you're displaying before
the actual data, especially if you're displaying just the image and not
including it in a HTML page.

i.e.:

-- read the jpg into a JPGSeq then:

puts(1, "Content-type: image/jpg;\n\n" & JPGSeq)

HTH,
Carl

--
[ Carl R White == aka () = The Domain of Cyrek = ]
[ Cyrek the Illogical /\ www.cyreksoft.yorks.com ]

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

3. Re: CGI OUTPUT

the problem is not the header, the problem is that when you
puts(1,JPEG_DATA), the puts procedure mutates and changes the data, like
every time it finds a 10 it changes it to a 13,10 which kills any jpeg.
probably because CON=1 is opened in in normal mode, not binary, and i need
to know how to puts to the console in binary mode, and how to getc(0) for it
in binary mode.

Thanks
----- Original Message -----
From: Carl W. <euphoria at cyreksoft.yorks.com>
Subject: Re: CGI OUTPUT


>
> xerox_irs at lvcm.com wrote:
>
> > How do you send binary outut using euphoria as cgi, becuase when I
> > just do puts(1,"Something Binary"&10) it prints out 'Something
> > Binary'&10&13 and when sending a picture like a jpeg that messes it
> > up, I'm Using Apache 1 on win98se
>
> IIRC, you need to send the MIME type of whatever you're displaying before
> the actual data, especially if you're displaying just the image and not
> including it in a HTML page.
>
> i.e.:
>
> -- read the jpg into a JPGSeq then:
>
> puts(1, "Content-type: image/jpg;\n\n" & JPGSeq)
>
> HTH,
> Carl
>
> --
> [ Carl R White == aka () = The Domain of Cyrek = ]
> [ Cyrek the Illogical /\ www.cyreksoft.yorks.com ]
>
> ==^================================================================
> This email was sent to: xerox_irs at lvcm.com
>
> EASY UNSUBSCRIBE click here: http://topica.com/u/?b1dd66.b3gzeQ.eGVyb3hf
> Or send an email to: EUforum-unsubscribe at topica.com
>
> TOPICA - Start your own email discussion group. FREE!
> http://www.topica.com/partner/tag02/create/index2.html
> ==^================================================================
>

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

4. Re: CGI OUTPUT

ok i used "_setmode" in "msvcrt.dll" to set the mode to binary and it no
longer changes all of the line breaks to cr/ln but it still doesn't like me
to output zeros, and i was wondering if somewhere in the "puts" procedure
when the file number is 0,1, or 2 that it messes around with the zeros in
euphoria?

----- Original Message -----
From: Robert Craig <rds at RapidEuphoria.com>
To: <EUforum at topica.com>
Subject: RE: CGI OUTPUT


>
> xerox_irs at lvcm.com wrote:
> > i need to know how to puts to the console in binary mode,
> > and how to getc(0) for it in binary mode.
>
> I think most C compilers for DOS/Windows
> have a routine called setmode() that lets you
> switch standard output or input into binary mode.
> Maybe I'll add a machine_proc() routine or something
> to do that, but isn't there a way of outputting
> a .jpg from CGI using some encoding like BASE64
> where binary/text mode wouldn't matter?
>
> If you're in a hurry, maybe you can call setmode()
> or equivalent via a .dll, or maybe insert a call into the
> Translator's output C code, in the main routine.
>
> This DOS/Windows concept of binary vs. text mode
> is really lame, and has cost billions of dollars
> in lost productivity for no good reason!
>
> Regards,
>    Rob Craig
>    Rapid Deployment Software
>    http://www.RapidEuphoria.com
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>

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

5. Re: CGI OUTPUT

i just used "kernel32.dll" "WriteFile", and "ReadFile" and they work fine
for jpegs and binary without any mods, i dont even need to use "setmode"

thanks for the help!!!!

----- Original Message -----
From: <xerox_irs at lvcm.com>
Subject: Re: CGI OUTPUT


>
> ok i used "_setmode" in "msvcrt.dll" to set the mode to binary and it no
> longer changes all of the line breaks to cr/ln but it still doesn't like
me
> to output zeros, and i was wondering if somewhere in the "puts" procedure
> when the file number is 0,1, or 2 that it messes around with the zeros in
> euphoria?
>
> ----- Original Message -----
> From: Robert Craig <rds at RapidEuphoria.com>
> To: <EUforum at topica.com>
> Sent: Thursday, March 13, 2003 5:49 PM
> Subject: RE: CGI OUTPUT
>
>
> > xerox_irs at lvcm.com wrote:
> > > i need to know how to puts to the console in binary mode,
> > > and how to getc(0) for it in binary mode.
> >
> > I think most C compilers for DOS/Windows
> > have a routine called setmode() that lets you
> > switch standard output or input into binary mode.
> > Maybe I'll add a machine_proc() routine or something
> > to do that, but isn't there a way of outputting
> > a .jpg from CGI using some encoding like BASE64
> > where binary/text mode wouldn't matter?
> >
> > If you're in a hurry, maybe you can call setmode()
> > or equivalent via a .dll, or maybe insert a call into the
> > Translator's output C code, in the main routine.
> >
> > This DOS/Windows concept of binary vs. text mode
> > is really lame, and has cost billions of dollars
> > in lost productivity for no good reason!
> >
> > Regards,
> >    Rob Craig
> >    Rapid Deployment Software
> >    http://www.RapidEuphoria.com
> >
> >
> > TOPICA - Start your own email discussion group. FREE!
> >
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu