Select to view content in your preferred language

Getting the URL address of an attachment (picture)

9618
7
12-18-2017 05:37 AM
CodraFrum
Emerging Contributor

Hi there,

I need to get the URL address of a picture attached to a survey record. (in order to be able to see it when I working with Shortlist builder (I need the URL address of the picture attached).
How does the picture attachment process work? (where are the pictures located on the service/server?)
(I need the picture attachment URL address)

Thank you in advance,

Codra

Tags (1)
7 Replies
CarmelConnolly
Esri Regular Contributor

Hi Codra, 

This tool might help: Show Attachments in Web Map Popup - it allows you to write the URL of attachments to a new field in the data.

This might be of use too: https://community.esri.com/groups/survey123/blog/2017/03/22/working-with-your-survey123-photos  

Carmel

CodraFrum
Emerging Contributor

Hi Carmel,

Thank you for your answer.

Maybe I wasn't specific with my question: If I'm creating a Story Map Shortlist and choose to use a "life" map as a source of my data I need to provide an URL of picture/thumbnail in order to display my pictures sent as "attachments" from a Survey form.

* When I populate a Feature with pictures/photos they reside as ATTACHMENTS and, as you said, I can see them in WebMap Popup windows. What I NEED and I DO NOT HAVE is the URL of the attachment!

My question was: HOW CAN I GET THE URL OF AN ATTACHMENT?

Waiting forward getting an answer,

Codra

0 Kudos
CarmelConnolly
Esri Regular Contributor

Hi Codra, 

To find the URL of an attachment, head to the service URL fo the feature service, https://services.arcgis.com/nzS0F0zdNLvs7nc8/arcgis/rest/services/whyScienceMatters/FeatureServer/0/ for example and click Query Attachments at the bottom the page. 

Here simply enter the ID of the feature you want the Attachment URL for, click Query Attachments (GET) and the attachments can be opeded to retrieve the URLs of them. 

This is a manual process, my previous post suggested a way to automate this. 

Carmel

by Anonymous User
Not applicable

Hey Carmel,

Is there a way to query the entire attachment service URL? 

Example: https://services1.arcgis.com/AGOInstanceName/ArcGIS/rest/services/FeatureName/FeatureServer/3/queryA...

'd like to make a copy of the whole attachment table related to a feature service... I can capture the data for the service but I can't capture the attachments that are related without iterating through all the object ids. Is there a better way?  

0 Kudos
CarmelConnolly
Esri Regular Contributor

Hi Brandon,

This link: How To: Download attachments from a hosted feature service explains how to download the attachments as a related table in a file geodatabase. Does this help?

Carmel

by Anonymous User
Not applicable

I appreciate the assist! I didn't want to go the replica method since I don't understand web replicas. 

I was looking for a generic URL call I could make to the related attachment table to get all the attachments back. Unfortunately the API doesn't work this way and you have to use the OID in your call to the attachment table then check for attachments. 

0 Kudos
DeepUppal
Emerging Contributor

Hello! Did you find out on how to query for getting the URL? Im having the same problem. I get get the rest if the data in the form but no URL... 

0 Kudos