Upload and download files via Rest Api (without embedded forms)

Hello folks,
Is there an option to upload a file (e.g. PDF) via the REST-Api, so the next process instance can get the file via GET from the /variables? We have to use the REST-API, because we are using external forms in our project. The goal is that the uploaded file can be downloaded from the person of the next process instance.
Thank you very much!

Best wishes

Hello @liridondema,
That is possible via Post Process Variable (Binary) | docs.camunda.org

Though it is technically possible it is definitely not considered as best practice as these PDF files will be stored in the Camunda tables and over time will grow the database very large. This might have a negative performance impact. Think about storing the files in some domain database and just hold a reference key as process variable.

Best, McAlm

Hello @McAlm

first of all thank you for your fast reply. Is there a practical example of the usage of Post Process Variable? Another question: what if we have to send data (e.g. information of a student) via the REST-API and then the documents of the student via the Post method?

Thanks and best wishes

Hi @liridondema, you find examples on the bottom of the doc page, if it is what you’re looking for.

You should consider an approach where your application first sends the document via a dedicated service to a document store, that service returns a UUID as reference and you’ll pass this reference id then as process variable to Camunda. When you need to retrieve the document you read first the according process variable and call a service that returns the document from you storage.
Best, McAlm