[REBOL] Re: jpeg images not working
From: gscottjones:mchsi at: 28-Aug-2002 20:52
From: "Tim Johnson"
> I'm attempting to use rebol to push jpeg
> images to a a web page. Rendering is not working.
>
> The beginning source of this looks as follows (between asterisks):
> *********************************************************************
> HTTP/1.0 200 OK
> Content-type: multipart/x-mixed-replace; boundary=--myboundary
>
> --myboundary
> Content-type: image/jpeg
>
> #{
> FFD8FFE000104A46494600010101025802580000FFDB00430001010101010101
> 0101010101010101010101010101010101010101010101010101010101010101
> *********************************************************************
>
> The '#{' appears to be the problem. How to I keep that
> from appearing?
> The code to write and write the images is as follows:
> .....
> t: read/binary to-file base-file
> print copy t
> .....
> How may I correct this?
Hi, Tim,
I am unfamiliar with "multipart/x-mixed-replace", but I can get the
following code to work (note your paths may be different). Maybe you can
adapt this to your fancier mime type:
#!/path/to/rebol --cgi -s
REBOL []
t: read/binary %//rebol/view/nyc.jpg
print "Content-type: image/jpeg^/"
set-modes system/ports/output [binary: true]
foreach u t [insert system/ports/output to-char u]
--Scott Jones