Build date: 2018-04-17 06:50
I have added a tracked entity attribute with a value type of FILE. Once I have uploaded the file to “/api/fileResources” I get back the usual response and grab the id of the newly created file and assign it to the tracked entity attribute and it saves correctly.
The issue I am struggling with is retrieving the file once it has been uploaded. If anyone could assist that would be great!
Are you trying to retrieve the file from the API/directly from the backend? Or does the user log in, open the tracker and try downloading the file from within the tracker app?
Markus
P.S. we are moving these topics to the community.dhis2.org - a great tool for collaborating, discussing in threads and building a searchable knowledge base at the same time.
We’re building a custom application that uses the DHIS API’s. I can get the file information when I call******“/api/fileResources/{id}”.** How do I actually view the uploaded file though or download it? I want to basically have an a tag that links to the file in our application.
Hi Ranvir, most files can be retrieved from 2.31 at /api/fileResources//data, except for files related to data values and attribute values. The reason is they require a different type of access check.
In your case you are working with Tracked Entity Attributes, so you can find your files at /trackedEntityInstances///image
Hi Ranvir, most files can be retrieved from 2.31 at /api/fileResources//data, except for files related to data values and attribute values. The reason is they require a different type of access check.
In your case you are working with Tracked Entity Attributes, so you can find your files at /trackedEntityInstances///image
Hey Markus,
We’re building a custom application that uses the DHIS API’s. I can get the file information when I call******“/api/fileResources/{id}”.** How do I actually view the uploaded file though or download it? I want to basically have an a tag that links to the file in our application.
Hey there Ranvir!
Are you trying to retrieve the file from the API/directly from the backend? Or does the user log in, open the tracker and try downloading the file from within the tracker app?
Markus
P.S. we are moving these topics to the community.dhis2.org - a great tool for collaborating, discussing in threads and building a searchable knowledge base at the same time.
Hey all,
DHIS information:
Version: 2.27
Build revision: e33b34d
Build date: 2018-04-17 06:50
I have added a tracked entity attribute with a value type of FILE. Once I have uploaded the file to “/api/fileResources” I get back the usual response and grab the id of the newly created file and assign it to the tracked entity attribute and it saves correctly.
The issue I am struggling with is retrieving the file once it has been uploaded. If anyone could assist that would be great!
I know since 2018 passed many years, but the question of retrieving saved FILE_RESOURCE type data still there. Could you point the API point how I can retrieve saved file from TEA?
I have tried:
/api/trackedEntityInstances/(tei id)/(attribute id)/data
/api/trackedEntityInstances/(tei id)/(attribute id)/file
/api/fileResources/(fileResource id)/data