Right now im doing this but getting errors:
@service.run
def upload_image( camera_uuid ):
query = (db.cameras.macaddress == camera_uuid )
camera_id = db(query).select(
db.cameras.id)[0]
db.videos[0]={ 'camera' : camera_id, 'file' : db.videos.file.store
(request.body, 'upload.flv') }
return True
The problem is that its generating 0 size files. But the file is
correct, and is created in the database correctly. Did i miss a step?
I am using the following curl line:
curl -T ~/test.flv
http://web2py.geiseri.com/HomeCentral/default/call/run/upload_image/camera1
I feel like im close...
On Aug 16, 1:55 pm, mdipierro <
mdipie...@cs.depaul.edu> wrote:
> Correction. This works but it probaby does not work with upload.
>
> you may need something like
>
> @auth.requires_login()
> def uploadme(): db.mytable.insert(filefield=request.body.read())
>
> On Aug 16, 12:50 pm, mdipierro <
mdipie...@cs.depaul.edu> wrote:
>
> > if you have:
>
> > def mycreate(): return dict(form=crud.create(db.mytable))
>
> > you normally call:http://..../mycreatetoget the form.