<?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: Export photos from field maps in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/export-photos-from-field-maps/m-p/1094617#M1649</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/509262"&gt;@FatimaGamino&lt;/a&gt;&amp;nbsp;,The workflow below enables you to add a sensible prefix onto the name of the photo, defined by a field of&amp;nbsp; your choice in your feature class, and downloads the lot into a folder of your choosing. Otherwise, you'll just end up with a load of photos with the same name.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Extract Attachments from a Hosted Feature Service to a folder with prefix name:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Script BELOW works in Pro&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Save Feature Service as a FGDB and Download to PC&lt;/LI&gt;&lt;LI&gt;Create a join of feature service to the ATTACH table in FGDB&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RELGLOBALID in table, to GLOBALID in FClass.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a string field in ATTACH table called Name&lt;/LI&gt;&lt;LI&gt;Edit ATTACH table&lt;/LI&gt;&lt;LI&gt;Field calculate the Name field to match your required Prefix for each attachment&lt;/LI&gt;&lt;LI&gt;Run the script, using the Name field as your prefix fielD&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy
from arcpy import da
import os

inTable = arcpy.GetParameterAsText(0)
fileLocation = arcpy.GetParameterAsText(1)
outputPrefix = arcpy.GetParameterAsText(2)

with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID', outputPrefix]) as cursor:
    for item in cursor:
        attachment = item[0]
        filenum = "ATT" + str(item[2]) + "_"
        filename = str(item[3]) + "_" + filenum + str(item[1])
        open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())
        del item
        del filenum
        del filename
        del attachment&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Sep 2021 15:33:09 GMT</pubDate>
    <dc:creator>David_Brooks</dc:creator>
    <dc:date>2021-09-02T15:33:09Z</dc:date>
    <item>
      <title>Export photos from field maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/export-photos-from-field-maps/m-p/1094611#M1648</link>
      <description>&lt;P&gt;I want to export the photos collected on my form in fieldmaps. I am able to see them when i open the map in ArcGIS, but I cannot find a way to download all at once.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 19:24:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/export-photos-from-field-maps/m-p/1094611#M1648</guid>
      <dc:creator>FatimaGamino</dc:creator>
      <dc:date>2021-09-01T19:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Export photos from field maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/export-photos-from-field-maps/m-p/1094617#M1649</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/509262"&gt;@FatimaGamino&lt;/a&gt;&amp;nbsp;,The workflow below enables you to add a sensible prefix onto the name of the photo, defined by a field of&amp;nbsp; your choice in your feature class, and downloads the lot into a folder of your choosing. Otherwise, you'll just end up with a load of photos with the same name.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Extract Attachments from a Hosted Feature Service to a folder with prefix name:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Script BELOW works in Pro&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Save Feature Service as a FGDB and Download to PC&lt;/LI&gt;&lt;LI&gt;Create a join of feature service to the ATTACH table in FGDB&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RELGLOBALID in table, to GLOBALID in FClass.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a string field in ATTACH table called Name&lt;/LI&gt;&lt;LI&gt;Edit ATTACH table&lt;/LI&gt;&lt;LI&gt;Field calculate the Name field to match your required Prefix for each attachment&lt;/LI&gt;&lt;LI&gt;Run the script, using the Name field as your prefix fielD&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy
from arcpy import da
import os

inTable = arcpy.GetParameterAsText(0)
fileLocation = arcpy.GetParameterAsText(1)
outputPrefix = arcpy.GetParameterAsText(2)

with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID', outputPrefix]) as cursor:
    for item in cursor:
        attachment = item[0]
        filenum = "ATT" + str(item[2]) + "_"
        filename = str(item[3]) + "_" + filenum + str(item[1])
        open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())
        del item
        del filenum
        del filename
        del attachment&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 15:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/export-photos-from-field-maps/m-p/1094617#M1649</guid>
      <dc:creator>David_Brooks</dc:creator>
      <dc:date>2021-09-02T15:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Export photos from field maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/export-photos-from-field-maps/m-p/1199623#M4252</link>
      <description>&lt;P&gt;I can get this to work to line 14, but no further...getting this error:&lt;/P&gt;&lt;PRE&gt;'str' object has no attribute 'tobytes'&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 21:04:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/export-photos-from-field-maps/m-p/1199623#M4252</guid>
      <dc:creator>motyad10</dc:creator>
      <dc:date>2022-08-04T21:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Export photos from field maps</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/export-photos-from-field-maps/m-p/1351971#M7423</link>
      <description>&lt;P&gt;This video may help&amp;nbsp;&lt;A href="https://mediaspace.esri.com/media/t/1_v3hg0nqg" target="_self"&gt;https://mediaspace.esri.com/media/t/1_v3hg0nqg&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 14:39:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/export-photos-from-field-maps/m-p/1351971#M7423</guid>
      <dc:creator>RishV-B</dc:creator>
      <dc:date>2023-11-21T14:39:47Z</dc:date>
    </item>
  </channel>
</rss>

