Managing whether attachments download to a device

1175
4
01-18-2017 04:55 AM
PaulHaakma
Regular Contributor

Hi all.

We have a client who is very concerned about the impact of attachments downloading to devices - lots of features and photos would obviously affect mobile data usage in the field and device storage.

The data would be taken into an offline geodatabase.

Ideally, they would like a feature class with attachments enabled, that can attach files to new features and upload the attachments but when syncing would not download any attachments created by any other users. In a perfect world, they could also somehow press a button and trigger a download of attachments for a set of selected features. In other words, they want quite fine grained control of when and whether attachments get downloaded to the mobile device.

I can see that "GenerateGeodatabaseParameters" has 'returnAttachments' property which applies to all layers in the feature service. I tested setting this to false, but it seemed to also disable the ability to add attachments locally to new features.

Can anyone advise whether this might be possible at all and how it might be acheived?

Cheers,

-Paul

0 Kudos
4 Replies
LucasDanzinger
Esri Frequent Contributor

This doesn't quite help you right now, but in version 100.0 of ArcGIS Runtime, you can set the attachment sync direction on the GenerateGeodatabaseParameters. There is the option to only allow upload - Enums.AttachmentSyncDirection enumeration | ArcGISQtQML 100.0 

As for the second part, I'm not sure how you would accomplish that. As for how the REST endpoint is setup right now, you can only specify whether to return attachments or not, as well as the attachment sync direction. On one hand, you are saying you want to be able to upload only, but on the other hand, you want to be able to download as well in certain circumstances. Maybe there could be an enhancement to the feature service where you can provide a where clause in the sync parameters to only get updates from features that match a where clause, or something like that.

PaulHaakma
Regular Contributor

Thanks Luke, it's good to know it's available in v100 and not in current version (saves me more time trying to find a way right now!).

Re the second part, the only other thoughts I had were to give them ability to access the layer directly whilst online and view attachments then, else hook up a button that downloaded a second small geodatabase with just that layer and area that *does* include attachments (assuming they insisted on them being available offline). Not ideal, but not impossible either.

Cheers,

-Paul

0 Kudos
LucasDanzinger
Esri Frequent Contributor

That was a workaround I was thinking of too, but it seemed potentially troublesome. You could manage 2 separate geodatabases. But I think that could get pretty tricky with making sure you were editing the correct one, and if you queried features, to know if you should query from the one you are editing or the one you are getting updated attachments from.

0 Kudos
PaulHaakma
Regular Contributor

Yeah, tricky alright. But we live for tricky....   

0 Kudos