Hi, PidTagAttachDataObject has a different type, PtypObject, which isn't transformed into a Python object at the mapistore_python layer. Moreover, the properties of this kind can't be accessed through the GetProperties* ROP but through the OpenStream or OpenEmbeddedMessage ones (see [MS-OXCDATA]), which aren't supported yet in rest.py. Therefore, you can safely support only PidTagAttachDataBinary.
PtypBinary properties are always encoded in base64, yes (we detect and encode them without caring about which particular property they are). I agree that it is not optimal and your proposed solution looks good. However, as we're not addressing optimisations yet, the status of this particular code isn't likely to change in the short term. Regards, Juan -- Juan Vallés Mobile: +34 622 24 17 18 Zentyal - Active Exchange www.zentyal.com -----Original Message----- From: devel [mailto:devel-boun...@lists.openchange.org] On Behalf Of Aleksander Machniak Sent: Friday, April 17, 2015 8:29 AM To: devel@lists.openchange.org Subject: Re: [openchange][devel] REST API: attachment bodies On 04/16/2015 05:36 PM, Juan Valles wrote: > What we're doing is converting the binary properties to bytearray > Python objects at the mapistore_python.c layer. Then, when we're > posting an attachment (rest.py layer), we loop over the properties and > we encode the binary ones in base 64. So, PidTagAttachDataBinary is base64 encoded binary data? There's also PidTagAttachDataObject, but I don't know the difference. Should I support both? Does that mean that properties of type pTypBinary are always base64-encoded in the API? Base64 doesn't look optimal for general purpose REST API. I'd expect a separate request for attachment body downloads, and multipart/form-data for uploads. -- Aleksander Machniak Software Developer, Kolab Systems AG ------------------------------------------------------- PGP:19359DC1 - http://kolabsys.com - http://alec.pl _______________________________________________ devel mailing list devel@lists.openchange.org http://mailman.openchange.org/listinfo/devel _______________________________________________ devel mailing list devel@lists.openchange.org http://mailman.openchange.org/listinfo/devel