[Twisted-web] Problems uploading data in web2
Henrik Thostrup Jensen
thostrup at gmail.com
Mon Feb 6 03:52:06 MST 2006
I'm trying to use web2 to stream uploading of data, but I ran into some
problems. First I tried building from the example in
however args and files objects in the request did not show anything.
However the length of stream was correct, and using tcpdump, showed the
correct value. So I tried building my own uploader which look like this:
def http_POST(self, ctx):
request = iweb.IRequest(ctx)
def parse_stream(self, stream):
from twisted.web2 import fileupload
s = fileupload.parse_urlencoded_stream(stream)
datas = s.read()
datas = fileupload.wait(datas)
datas = datas.getResult()
Using the 0.1.0 release of web2 didn't get past the yield line. Using latest
from subversion (revision 15836), got past, but datas was None, even though
data had been send. I've used both cURL (using the -d switch) and wget
(using the --post-file switch) for uploading data, so I do not think the
client as malfunctioning. What am I doing wrong?
I'm aware that web2 is under development and all that, but I need streaming
upload, so the web module is not an option.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-web