[REBOL] Re: html post
From: g:santilli:tiscalinet:it at: 6-Aug-2002 11:10
Hi Javier,
On Tuesday, August 6, 2002, 7:43:07 AM, you wrote:
JD> My problem is that the uploaded files seems to be corrupted. Text/files
JD> have the CR/LF changed altough the save specifies bynary. And save files
JD> seems to be some of bytes bigger...
I assume you are reading your data from the server via
SYSTEM/PORTS/INPUT; this port is, by default, opened as STRING,
not BINARY, and this is the reason for the conversion of line
terminators (and thus corruption of binary files).
A:
set-modes system/ports/input [binary: true]
at the start of your CGI script should be enough to solve your
problem. (Maybe you'll need to switch it back to STRING mode for
outputting data, but it should not be required if you pay
attention to the line terminators you are sending.)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r