[Zope] getting post data from a webcam

Tino Wildenhain tino at wildenhain.de
Wed Jul 9 02:04:36 EDT 2008


William Heymann wrote:
> I am trying to integrate a webcamera with a site and I can get it to POST the 
> data to a certain url on the server the problem is I can't figure out how to 
> get access to the data. It is not in REQUEST.form
> 
> the relevant request vars are
> 
> ('CONTENT_LENGTH', '111695')
> ('CONTENT_TYPE', 'image/jpeg')
> ('HTTP_CONTENT_DISPOSITION', 'attachment; 
> filename="image01-07-29_05-54-26-96.jpg"')
> 
> This is being posted to a python script object inside zope, however if I need 
> to use an external method that is not a problem I just need to figure out how 
> to get the data.

If the file is posted as attachment (similar to file upload) it should
appear in the relevant form element as file. You can just use the method
.read() on it to get the data (or feed it into factory of image/file)

For this to work the data needs to be sent as 
enctype="multipart/form-data" (hopefully the cam does this).

Maybe you send all variables of the request to figure out.

Regards
Tino

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.zope.org/pipermail/zope/attachments/20080709/9dc46691/smime.bin


More information about the Zope mailing list