3

I see an older thread on the forum about potential improvements to the API to allow file uploads, but I'm not sure that ever happened. Has anyone ever uploaded files in CiviCRM using the API?

I see in the API Explorer that there is a File > Create with a parameter for File Contents but I'm not sure if you feed in the MIME contents, a URL, or...?

File via API

  • fantastic, that is good to know. does anyone know if we can provide an externalized attachment storage, example s3 buckets or firebase storage ? That is easier to scale than having it on the server running civi. – Jeff Salleh Apr 6 at 14:32
  • I think that warrants a question of its own. Also I don't know the answer. :) – Laryn - CEDC.org Jun 11 at 19:50
5

Yes, it did happen and it's called the "attachment" api. You can look up the docs for it in the api explorer:

enter image description here

  • Thanks! And I confess my ignorance - does webform-civicrm use this so file uploads don't rely on the form submission not being deleted anymore? – Laryn - CEDC.org May 30 '16 at 14:47
  • 2
    It does for almost everything. The one exception is the "contact image_url" because Civi does not store an actual file in that field, just the url. So that currently is still only stored in the webform submission. – Coleman May 31 '16 at 3:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.