Here's an update:
The POST request when seen as text looks like this:
------------cH2Ij5cH2ae0gL6Ef1ae0cH2KM7ae0
Content-Disposition: form-data; name="Filename"
test video.flv
------------cH2Ij5cH2ae0gL6Ef1ae0cH2KM7ae0
Content-Disposition: form-data; name="Filedata"; filename="test
video.flv"
Content-Type: application/octet-stream
...video content here in junk chars...
------------cH2Ij5cH2ae0gL6Ef1ae0cH2KM7ae0
Content-Disposition: form-data; name="Upload"
Submit Query
------------cH2Ij5cH2ae0gL6Ef1ae0cH2KM7ae0--
It looks like a form submit. My web2py code is this:
def upload():
"""
uploads an flv file to server, creates a database entry for it.
"""
db.videodata.insert(flvcopy=db.videodata.flvcopy.store
(request.vars.Filedata,'test1.flv'))
but this gives me an error I cannot understand.
Traceback (most recent call last):
File "gluon/restricted.py", line 184, in restricted
File "C:/Home/Software/Development/web2py/applications/videotag/
controllers/default.py", line 72, in <module>
File "gluon/globals.py", line 102, in <lambda>
File "C:/Home/Software/Development/web2py/applications/videotag/
controllers/default.py", line 70, in upload
File "gluon/sql.py", line 2357, in store
File "shutil.pyc", line 21, in copyfileobj
File "cgi.pyc", line 548, in __getattr__
AttributeError: read
Any help here?