2

I try to figure out if I can upload media files, using curl (or anything else really), to python-eve field that is inside a dict type.

The documentation, http://docs.python-eve.org/en/latest/features.html, only have the simple example of

accounts = {
    ...,
    'pic': {'type': 'media'},
    ...
}
curl -F "pic=@profile.jpg"

But what about this one?

accounts = {
    ...,
    'extras': {
        'type': 'dict',
        'schema': {
            'pic': {'type': 'media'},
            ...
        }
    }
}

I've tried with curl -F "extras.pic=@profile.jpg", curl -F "extras:pic=@profile.jpg" etc

I've also experimented with sub resources without luck.

I am about to accept that I'm not allowed to structure my schema as I wish, but if there is a way, I'd be very happy to know.

eigil
  • 1,172
  • 2
  • 12
  • 23
  • Have you seen the media file storage section in python-eve documentation yet ? https://docs.python-eve.org/en/stable/features.html#file-storage – Saad Apr 16 '19 at 05:59
  • Have you been able to this? I'm trying it with no luck... – Elias Garcia Sep 04 '19 at 21:48
  • @EliasGarcia no, no luck here either. – eigil Sep 09 '19 at 12:45
  • How about uploading multiple media files at once? Already activated AUTO_COLLAPSE_MULTI_KEYS = True, AUTO_CREATE_LISTS = True, MULTIPART_FORM_FIELDS_AS_JSON = True – haytham Sep 20 '19 at 15:28
  • The link [https://github.com/nicolaiarocci/eve/blob/develop/eve/flaskapp.py#L615] is a 404 unfortunately. It is supposed to describe this very problem according to [https://github.com/pyeve/eve/issues/932]. Thanks for your help anyway – eigil Sep 24 '19 at 16:54

0 Answers0