← Back to team overview

dhis2-users team mailing list archive

Re: File Uploads Tracked Entity Attributes

 

Hi Ranvir, most files can be retrieved from 2.31 at
/api/fileResources/<uid>/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/<tei uid>/<attribute uid>/image

On Wed, Nov 14, 2018 at 11:35 AM Ranvir Maharaj <ranvir@xxxxxxxxxxx> wrote:

> 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.
>
> Regards,
> *Ranvir Maharaj*
> Senior Software Developer
>
> *Avocado Chocolate*
> *Software that is good for you*
>
> t. +27 78 7150186
> e. ranvir@xxxxxxxxxxx
>
> 46 Louis Botha Crescent
> Port Elizabeth
> www.avochoc.com
>
>
> On Wed, Nov 14, 2018 at 11:10 AM Markus Bekken <markus@xxxxxxxxx> wrote:
>
>> 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.
>>
>> 14. nov. 2018 kl. 08:29 skrev Ranvir Maharaj <ranvir@xxxxxxxxxxx>:
>>
>> 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!
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>


-- 
Stian Sandvold
Software developer, DHIS2
University of Oslo
http://www.dhis2.org

Follow ups

References