<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Feature service attachments- how to access them &amp; use? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593465#M29722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the script. I tried running it and got a syntax error on the 2nd line....think it was because the data owner name was in quotes. So I changed it to this (was "COGMASTER\AGS" before)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... tbl = r"C:\Users\choward\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\Connection to TPBData.sde\TPBData.COGMASTER\AGS.BikeBeltway_inner__ATTACH"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that, nothing seems to happen. I do not use python much so maybe I am just missing a simple thing. I copied the code into the python window in Catalog, maybe I should save as a file and run somewhere/how?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Mar 2015 13:21:58 GMT</pubDate>
    <dc:creator>C_EHoward</dc:creator>
    <dc:date>2015-03-31T13:21:58Z</dc:date>
    <item>
      <title>Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593461#M29718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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 &amp;amp; how they can be related to the GDB that contains the feature classes to which the attachments belong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My uploaded attachments are visible at the REST endpoint, such as &lt;/P&gt;&lt;P&gt;//myserver/arcgis/rest/services/Folder/ServiceName/FeatureServer/1/26/attachments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also see that the attachments are in the following folder on my AGS machine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;\\arcgisserver\directories\arcgissystem\arcgisuploads\scratch- all attachments are seen here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also see some non-image&amp;nbsp; attachments here:&lt;/P&gt;&lt;P&gt;\\arcgisserver\directories\arcgisoutput\Folder\ServiceName_MapServer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please help me untangle the web.....thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 16:42:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593461#M29718</guid>
      <dc:creator>C_EHoward</dc:creator>
      <dc:date>2015-03-26T16:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593462#M29719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi C E,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the relationship class properties (right-click &amp;gt; Properties) between the feature class an attachment table.&amp;nbsp; It will tell you the fields used for the relationship.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/79046_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 21:00:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593462#M29719</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-03-26T21:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593463#M29720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response. This is not what I am asking exactly. I am trying to figure out how to actually use the attachments that are uploaded by users when editing. The files are accessible at the REST endpoint by the name that the user gives. However, the only place I have been able to physically find the files (as in storage location other than a URL) is in the scratch folder I mention above. The only thing in the attach table is the REL_OBJECTID like you mention, that relates to the position in REST where the attachment resides. But there is nothing in the files themselves anywhere that I can easily download and assign a particular file to a record since the scratch files do not have the REL_OBJECTID. &lt;/P&gt;&lt;P&gt;Do these attachments with useful names/IDs live anywhere other than REST? If not, how can I collect these attachments besides manually? thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 12:58:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593463#M29720</guid>
      <dc:creator>C_EHoward</dc:creator>
      <dc:date>2015-03-27T12:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593464#M29721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the following script to download all of the attachments.&amp;nbsp; The attachment name will match the name of the ATT_NAME field in attachments table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os, arcpy
tbl = r"C:\Projects\SQLServer.sde\VECTOR.VECTOR.Graffiti__ATTACH"
fldBLOB = 'DATA'
fldAttName = 'ATT_NAME'
outFolder = r"C:\Temp\Attachments"

with arcpy.da.SearchCursor(tbl,[fldBLOB,fldAttName]) as cursor:
&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; binaryRep = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fileName = row[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # save to disk
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; open(outFolder + os.sep + fileName, 'wb').write(binaryRep.tobytes())

print 'Finished'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:29:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593464#M29721</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T01:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593465#M29722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the script. I tried running it and got a syntax error on the 2nd line....think it was because the data owner name was in quotes. So I changed it to this (was "COGMASTER\AGS" before)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... tbl = r"C:\Users\choward\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\Connection to TPBData.sde\TPBData.COGMASTER\AGS.BikeBeltway_inner__ATTACH"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that, nothing seems to happen. I do not use python much so maybe I am just missing a simple thing. I copied the code into the python window in Catalog, maybe I should save as a file and run somewhere/how?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 13:21:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593465#M29722</guid>
      <dc:creator>C_EHoward</dc:creator>
      <dc:date>2015-03-31T13:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593466#M29723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have the 'outFolder' path created on your server?&amp;nbsp; In the example, the attachments are being written to 'C:\Temp\Attachments'.&amp;nbsp; Make sure this folder exists.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 11:32:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593466#M29723</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-04-01T11:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593467#M29724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, I have that folder already created. I am thinking its something with my SDE connection string, but this is the location for it....only difference is the quotes as mentioned above. I am going to copy the string again and try one more time.....stay tuned&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I log this as an official support case? only hesitation there is it usually takes longer to get a response. But I need to figure out how to use the attachments people will be providing (any day now, my app goes live next week)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 12:39:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593467#M29724</guid>
      <dc:creator>C_EHoward</dc:creator>
      <dc:date>2015-04-01T12:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593468#M29725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This time I get this&lt;/P&gt;&lt;P&gt;Runtime error &lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 7, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;RuntimeError: cannot open 'C:\Users\choward\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\Connection to TPBData.sde\TPBData.COGMASTER\AGS.BikeBeltway_inner__ATTACH'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should mention that the C drive in this line is my workstation, and the C:\temp is on my server machine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 12:48:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593468#M29725</guid>
      <dc:creator>C_EHoward</dc:creator>
      <dc:date>2015-04-01T12:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593469#M29726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you send a screen shot of how the attachment appears in your catalog window?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 13:23:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593469#M29726</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-04-01T13:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593470#M29727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response....here is the attachment table. I only see the attachments via the REST endpoint or in the scratch folder &lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/80938_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 13:47:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593470#M29727</guid>
      <dc:creator>C_EHoward</dc:creator>
      <dc:date>2015-04-01T13:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593471#M29728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the following for the tbl variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14278964621209526" data-renderedposition="50_8_912_16" jivemacro_uid="_14278964621209526"&gt;&lt;P&gt;tbl = r'&lt;SPAN class="string"&gt;Database Connections\Connection to TPBData.sde\TPBData."COGMASTER\AGS".BikeBeltway_inner__ATTACH'&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="string"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="string"&gt;Also, create the 'C:\Temp\Attachments' directory on your machine.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 13:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593471#M29728</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2015-04-01T13:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593472#M29729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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). &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I appreciate the script, it will no doubt come in handy. Thanks for all the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Apr 2015 13:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593472#M29729</guid>
      <dc:creator>C_EHoward</dc:creator>
      <dc:date>2015-04-06T13:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Feature service attachments- how to access them &amp; use?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593473#M29730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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&amp;nbsp;&lt;STRONG&gt;tbl = arcpy.GetParameter(0)&amp;nbsp;&lt;/STRONG&gt;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-&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/364274_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2017 15:11:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/feature-service-attachments-how-to-access-them-use/m-p/593473#M29730</guid>
      <dc:creator>C_EHoward</dc:creator>
      <dc:date>2017-07-25T15:11:54Z</dc:date>
    </item>
  </channel>
</rss>

