Hi!
software:
web.py: 0.32, connecting directly to the builtin webserver
Flash: 9,0,124,0
Flash uploader: uploadify.com, version 1.6.2
problem:
I want to provide a multi file upload for my app using Flash. At first
I got the following error:
Traceback (most recent call last):
File "3rdparty/web/application.py", line 242, in process
return self.handle()
File "3rdparty/web/application.py", line 233, in handle
return self._delegate(fn, self.fvars, args)
File "3rdparty/web/application.py", line 412, in _delegate
return handle_class(cls)
File "3rdparty/web/application.py", line 387, in handle_class
return tocall(*args)
File "/home/fnoeding/project/website/pages/pictures.py", line 87, in
POST
input = web.input(file={}, cookie='')
File "3rdparty/web/webapi.py", line 251, in input
a = cgi.FieldStorage(fp=fp, environ=e, keep_blank_values=1)
File "/usr/lib/python2.6/cgi.py", line 508, in __init__
self.read_multi(environ, keep_blank_values, strict_parsing)
File "/usr/lib/python2.6/cgi.py", line 637, in read_multi
environ, keep_blank_values, strict_parsing)
File "/usr/lib/python2.6/cgi.py", line 510, in __init__
self.read_single()
File "/usr/lib/python2.6/cgi.py", line 647, in read_single
self.read_lines()
File "/usr/lib/python2.6/cgi.py", line 669, in read_lines
self.read_lines_to_outerboundary()
File "/usr/lib/python2.6/cgi.py", line 697, in
read_lines_to_outerboundary
line = self.fp.readline(1<<16)
File "3rdparty/web/wsgiserver/__init__.py", line 206, in readline
data = self.rfile.readline(size)
File "3rdparty/web/wsgiserver/__init__.py", line 868, in readline
data = self.recv(self._rbufsize)
File "3rdparty/web/wsgiserver/__init__.py", line 747, in recv
return self._sock.recv(size)
timeout: timed out
When using a normal http upload form it just works. I found out that
the esential difference between the flash upload and html upload is,
that the MIME multipart body of Flash is not terminated by a '\r\n'.
So read_lines_to_outerboundary gets stuck.
My current workaround is to intercept the socket.timeout exception by
monkey patching, but that way I'm adding 5 to 20 seconds to the upload
time, which is not acceptable for small files.
Does anyone have a better solution for this problem / a working flash
upload using web.py?
Regards,
Florian Nöding
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---