Feature service attachments- how to access them & use?

6796
12
Jump to solution
03-26-2015 09:42 AM
C_EHoward
Occasional Contributor III

I have a web app that allows users to upload an attachment with the map note they draw on the map. That seems to work as expected. but once I have attachments, I do not see logically where they should be accessed & how they can be related to the GDB that contains the feature classes to which the attachments belong.

My uploaded attachments are visible at the REST endpoint, such as

//myserver/arcgis/rest/services/Folder/ServiceName/FeatureServer/1/26/attachments

I also see that the attachments are in the following folder on my AGS machine:

\\arcgisserver\directories\arcgissystem\arcgisuploads\scratch- all attachments are seen here

My question now is how to make the connection between the scratch folder contents (with long numeric file names) and my attachments? I can click on the REST endpoint to get them. They are also listed in the ATTACH table in my SQL GDB that is the managed database for my data. But I do not see the connection between the two.

I also see some non-image  attachments here:

\\arcgisserver\directories\arcgisoutput\Folder\ServiceName_MapServer

I would like to be able to have some way to more easily find the attachments on my server after users upload content. Right now there does not seem to be a way to relate the files by name or other field.


Please help me untangle the web.....thanks

0 Kudos
12 Replies
JakeSkinner
Esri Esteemed Contributor

Try the following for the tbl variable:

tbl = r'Database Connections\Connection to TPBData.sde\TPBData."COGMASTER\AGS".BikeBeltway_inner__ATTACH' 

Also, create the 'C:\Temp\Attachments' directory on your machine.

0 Kudos
C_EHoward
Occasional Contributor III

Thanks for the reply and suggestion. I used this syntax and added the table name and it worked. I have my attachments from each table in the temp folder now. Now that they are there I can at least assign the correct attachment to the correct feature and eventually join the attach table to the feature class to get the attachments to appear in a web map (when its ready).


I appreciate the script, it will no doubt come in handy. Thanks for all the help!

0 Kudos
C_EHoward
Occasional Contributor III

Is there a way I can make my input database connection and the output folder a parameter in a model? So far, I tried modifying the script to have tbl = arcpy.GetParameter(0) and then define my parameter in a model, but ArcMap keeps crashing....so I do not think I am modifying the script correctly or choosing the right kind of parameter (its an SDE table). The script I am using is the same as was provided previously. I would like to share this model with folks using our Collector app so they can download the photos taken out in the field. and it would be easier to give a model than modify the script each time. thanks-

0 Kudos