<?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 attachment error in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156380#M8765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;C:\Users\BBrzezinski\Desktop\Export.py - path of script;&lt;/P&gt;&lt;P&gt;D:\07_PRACE_GIS\Phyton_Toolbox\Toolbox.tbx - path of toolbox&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Sep 2016 12:45:52 GMT</pubDate>
    <dc:creator>BartoszBrzeziński1</dc:creator>
    <dc:date>2016-09-01T12:45:52Z</dc:date>
    <item>
      <title>Export attachment error</title>
      <link>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156376#M8761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I`m using this script to export attachments from my geodatabase:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import da&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;inTable = arcpy.GetParameterAsText (0)&lt;BR /&gt;fileLocation = arcpy.GetParameterAsText (1)&lt;/P&gt;&lt;P&gt;with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID']) as cursor:&lt;/P&gt;&lt;P&gt;for item in cursor:&lt;/P&gt;&lt;P&gt;attachment = item[0]&lt;BR /&gt; filenum = str(item [2]) + "_"&lt;BR /&gt; filename = str(item[1])&lt;BR /&gt; open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())&lt;BR /&gt; del item &lt;BR /&gt; del filenum&lt;BR /&gt; del filename&lt;BR /&gt; del attachment&lt;/P&gt;&lt;P&gt;During procedure i get this warning:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/218918_Error.png" style="width: 741px; height: 238px;" /&gt;&amp;nbsp;Do you have idea what is wrong? Thanks for help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 10:53:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156376#M8761</guid>
      <dc:creator>BartoszBrzeziński1</dc:creator>
      <dc:date>2016-09-01T10:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Export attachment error</title>
      <link>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156377#M8762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes... your folder D:\07_.... &lt;/P&gt;&lt;P&gt;Copy and paste as text the actual folder name.&lt;/P&gt;&lt;P&gt;Always use raw encoding&amp;nbsp; especially if you have a different internationalization.&amp;nbsp; ie r"D:\MyStuff"&lt;/P&gt;&lt;P&gt;This line at the very top of your scripts goes a long way to fixing some issues&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# -*- coding: UTF-8 -*-&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I assume python 2.7? and ArcMap?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 12:17:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156377#M8762</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-01T12:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Export attachment error</title>
      <link>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156378#M8763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, i`m using ArcMap 10.4.1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 12:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156378#M8763</guid>
      <dc:creator>BartoszBrzeziński1</dc:creator>
      <dc:date>2016-09-01T12:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Export attachment error</title>
      <link>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156379#M8764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So what is the path??? it is not being interpreted properly and that suggests an issue with the characters in the folder path, which may be internationalization issues or the path strings are being interpreted wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/08/14/filenames-and-file-paths-in-python"&gt;Have a look at this...&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 12:41:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156379#M8764</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-01T12:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export attachment error</title>
      <link>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156380#M8765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;C:\Users\BBrzezinski\Desktop\Export.py - path of script;&lt;/P&gt;&lt;P&gt;D:\07_PRACE_GIS\Phyton_Toolbox\Toolbox.tbx - path of toolbox&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 12:45:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156380#M8765</guid>
      <dc:creator>BartoszBrzeziński1</dc:creator>
      <dc:date>2016-09-01T12:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Export attachment error</title>
      <link>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156381#M8766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need raw formatting... and beginning a path with a space is not good practice for obvious reasons&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"D:\07_PRACE_GIS\Phyton_Toolbox\Toolbox.tbx"&lt;/SPAN&gt;

p
Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'D:\x07_PRACE_GIS\\Phyton_Toolbox\\Toolbox.tbx'&lt;/SPAN&gt;

p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"D:\07_PRACE_GIS\Phyton_Toolbox\Toolbox.tbx"&lt;/SPAN&gt;

p
Out&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'D:\\07_PRACE_GIS\\Phyton_Toolbox\\Toolbox.tbx'&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/export-attachment-error/m-p/156381#M8766</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T08:17:57Z</dc:date>
    </item>
  </channel>
</rss>

