CGI File Upload
fluxent at yahoo.com
Wed Dec 6 19:23:16 CET 2000
In article <ulmttsihs.fsf at cs.uu.nl>,
piet at cs.uu.nl wrote:
> >>>>> Bill Seitz <fluxent at yahoo.com> (BS) writes:
> BS> Hmm, this works for me with text data (though the file length is
> BS> slightly different: maybe line-end changes from Win to *nix?).
> BS> binary it's totally off. Uploading a JPEG I consistently only get
> BS> bytes written to the file system. With GIFs I consistently get
> BS> bytes (but not always exactly the same number). With an MsWord
> BS> get a bigger file written, but still not the whole thing (60kb
> BS> 75kb).
> BS> What do I do next?
> Is your server on Windows? Then it probably is a matter of the
> input being in text mode rather than binary mode.
> So you have to set it to binary mode before anything is read from it.
> See msvcrt.setmode()
Yes, this turned out to be the issue. I had it set for stdout, but not
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list