Printing binary content

Started by Jeff, February 19, 2009, 06:38:36 AM

Previous topic - Next topic

Jeff

I am writing an application that needs to sort of proxy data between two sources over HTTP. I am using get-url to fetch the data, but cannot output the data to a web browser using write-buffer or print, because the data may contain null characters and these seem to halt output at null chars. Is there any way to force it?  I can pack and unpack it and see it if it is serialized to a string in a list, I can even write it to a file. But if it is going to an output like stdio or a browser, it stops at the first null. Any ideas?
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code

Jeff

#1
Ok... write-buffer with device does not work, but:


(setf content (get-url "http://localhost/test.gif"))
(write-buffer 1 "Content-type: image/gifnn")
(write-buffer 1 content (length content))


...manually using 1 as the out in a cgi seems to work :/
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code