file uploads / apache 2 windows xp

5 views
Skip to first unread message

dkeeney

unread,
Nov 27, 2007, 7:58:34 AM11/27/07
to colubrid-users

I am having difficulties uploading files through a form to a Colubrid
application.


For a 20Kb binary file uploaded, only the first 100 bytes or so are
received and stored on the server. All form fields after the file
upload field are also lost, and do not appear in the request.forms
attribute.

I am testing using Firefox 2, and Apache 2 (both are current versions
as of Nov 2007) localhost'ed under Windows XP. The Colubrid app is
run by the wsgiref CGIHandler , as an Apache CGI script.

I have tested this app under the python standard lib's httpcgiserver
also, on this machine, and not had the problem. I have successfully
uploaded files using a similar colubrid app on a unix hosting account.

Is the environment['wsgi.input'] input handle guaranteed to be binary
mode? It seems like the input is aborting before completion, possibly
on an EOF char?

Does anybody recognize this problem, or have any advice on resolving
it?

Thank you
David

dkeeney

unread,
Nov 27, 2007, 6:24:34 PM11/27/07
to colubrid-users

I found my problem, and it was not a Colubrid problem but a Python
config problem.

In case Google brings anyone to this page who is struggling with the
same symptoms...

For cgi scripts on a Windows platform, python needs to use unbuffered
input.
Various issues related to python as cgi are covered on:

http://www.imladris.com/Scripts/PythonForWindows.html

I used the 'SetEnv PYTHONUNBUFFERED 1' method, and it seems to be
working.

David
Reply all
Reply to author
Forward
0 new messages