How do you enable exifInfo on attachments?

367
2
03-29-2021 11:38 AM
Labels (2)
amurdoch24
New Contributor II

Good Day

I'm trying to figure out how to view the exifInfo data after I fetch the attachments from ArcGIS JavaScript.   I added attachments to the feature and I know road1 and road5 have exif data:

amurdoch24_0-1617042932810.png

When I fetch the data I get this object back:

amurdoch24_1-1617042995446.png


How do I enable the exifInfo?  I was reading about a flag that I have to turn on in the settings of the feature layer but I can't see or find any option for this.

Thanks

Tags (2)
0 Kudos
2 Replies
amurdoch24
New Contributor II

Setting returnMetadata: true in the query doesn't work and I can't find the setting in the feature service settings.

amurdoch24
New Contributor II

Solution:  Don't use the getAttachments function from the library, if you build the URL for the query, including returnMetadata, and use a plain httpGet, you'll have success. 

I ended up using this function to grab the attachments, and they came with their EXIF Data:

const objectQuery = '?objectIds=' + result.features[0].attributes.FID;
const json = '&f=json';
const returnMeta = '&returnMetadata=true';
const token = '&token=' + this._session.token;
const attachmentUrl = this.attachmentURL + 'queryAttachments' + objectQuery + token + returnMeta + json;

// TODO: Place a proper type reference here
this.http.httpNoHeader(attachmentUrl).then((attachmentRes: any) => {
console.log('Manual Attachment Query');
console.log(attachmentRes);
}).catch((error) => {
console.log('Error');
console.log(error);
});

 

0 Kudos