Get size of POST in an SQLFORM controller

10 views
Skip to first unread message

Dave S

unread,
Mar 2, 2016, 9:38:24 PM3/2/16
to web2py-users
I have 2 controllers for doing uploads:  one is a REST target and one uses SQLFORM.  Is there an easy way to get the actual size of the POST contents in the SQLFORM version?  I tried

   request.body.seek(0,os.SEEK_END)
   upsize
= request.body.tell()

but that seems to get an inflated count (headers, maybe?).

In the REST version, I do

   data=request.body.read()
   upsize
= len(data)

Is that what I should use with SQLFORM, or is there something with the information already in hand?

Thanks

/dps

Reply all
Reply to author
Forward
0 new messages