Select to view content in your preferred language

Accessing Attachments from mapService instead of featureService

1800
5
08-08-2013 12:33 PM
by Anonymous User
Not applicable
is this possible? Users do not need editing ability. All the samples I've seen use featureServices and include the ability to edit.

Thanks!

rGibson
5 Replies
JesvinValencia
Deactivated User
Map services do not support adding, updating, or deleting attachments.  You'll need a feature service to perform these operations.  However, you can query attachment information from a map service through the Attachment Infos resource (see the REST API topic here, under Map Service > Dynamic Layer/Table > Feature > Attachment Infos).  Hope this helps.
0 Kudos
by Anonymous User
Not applicable
Map services do not support adding, updating, or deleting attachments.  You'll need a feature service to perform these operations.  However, you can query attachment information from a map service through the Attachment Infos resource (see the REST API topic here, under Map Service > Dynamic Layer/Table > Feature > Attachment Infos).  Hope this helps.


Thanks, Jesvin. Good information.

I was hoping there would be a way to access the info via an identifyTask from a single map service but that doesn't seem possible. As I would have as many as 20+ layers containing attachments.

Thanks again!

rGibson
0 Kudos
JasonZou
Frequent Contributor
I would echo Russell's suggestion. Often times, the attachments have already been set up in the feature class. The end users will only need to access them via the web map instead of editing them. It will be nice to make the attachments available for identify and query operations. A flag variable may be good to have to control if attachments will be returned.
0 Kudos
Hernando_CountyProperty_Apprai
Regular Contributor
I know this is an old thread but I'm trying to do the same thing - have attachments show in when doing an identifytask.  Did you ever get this working and if so would you mind sharing how?

Thank you
0 Kudos
StevenGraf1
Frequent Contributor
The only way I have found to do it is using a feature layer with the popup template.  If you use these you can add the line showAttachments:true, and an attachment link will show in the bottom of the popup window.

var template = new PopupTemplate({
          title: "My Title",
          fieldInfos: [    
    {fieldName: "Address", label: "<b>Address:</b>", visible: true},
    {fieldName: "City_1", label: "<b>City:</b>", visible: true}],
    showAttachments:true,
    
        });

var featureLayer = new FeatureLayer("myurl/FeatureServer/15",{
          mode: FeatureLayer.MODE_ONDEMAND,
          outFields: ["*"],
          infoTemplate:template
        });


Having this ability with a map service instead would be great.
0 Kudos