Hi<br>
<br>
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&nbsp;
<a href="http://twistedmatrix.com/projects/web2/documentation/examples/demo.html">http://twistedmatrix.com/projects/web2/documentation/examples/demo.html</a>,
however args and files objects in the request did not show
anything.&nbsp; 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:<br>
<br>
class Uploader(resource.PostableResource):<br>
&nbsp;&nbsp;&nbsp; def http_POST(self, ctx):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; request = iweb.IRequest(ctx)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.parse_stream(request.stream)<br>
<br>
&nbsp;&nbsp;&nbsp; @defer.deferredGenerator<br>
&nbsp;&nbsp;&nbsp; def parse_stream(self, stream):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from twisted.web2 import fileupload<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; s = fileupload.parse_urlencoded_stream(stream)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while True:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datas = s.read()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datas = fileupload.wait(datas)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yield datas<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datas = datas.getResult()<br>
<br>
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?<br>
<br>
I'm aware that web2 is under development and all that, but I need streaming upload, so the web module is not an option.<br>
<br>-- <br>&nbsp;&nbsp; - Henrik