<?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: Notebook Server: Working with &amp;quot;local&amp;quot; content. in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/notebook-server-working-with-quot-local-quot/m-p/1100299#M31136</link>
    <description>&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;I've accomplished this with the ArcGIS REST API and a POST and the &lt;STRONG&gt;import requests&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What I'd really like to do is use the Python API for ArcGIS: e.g., &lt;STRONG&gt;cr_lyr.attachments.add(1, 'C:\\Users\\rohit\\AppData\\Local\\Temp\\AppTemplate.png'&lt;/STRONG&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 14:26:34 GMT</pubDate>
    <dc:creator>DirkVandervoort</dc:creator>
    <dc:date>2021-09-21T14:26:34Z</dc:date>
    <item>
      <title>Notebook Server: Working with "local" content.</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/notebook-server-working-with-quot-local-quot/m-p/1099569#M31123</link>
      <description>&lt;P&gt;By "local" content, I mean (mostly) files. JPGs, spreadsheets, text files, etc. These artifacts can be obtained requesting a REST endpoint which can return the contents of a file (the binary)&lt;/P&gt;&lt;P&gt;On ArcGIS Notebook Server I would like to obtain a file's binary, and do something with it, like attach it to a feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the documentation (&lt;A href="https://developers.arcgis.com/python/guide/using-attachments-with-feature-layers/)" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/guide/using-attachments-with-feature-layers/)&lt;/A&gt;&amp;nbsp;the attachments.add method requires a path to a file (e.g.,&amp;nbsp;&lt;SPAN class=""&gt;C:&lt;/SPAN&gt;&lt;SPAN class=""&gt;\\&lt;/SPAN&gt;&lt;SPAN class=""&gt;Users&lt;/SPAN&gt;&lt;SPAN class=""&gt;\\&lt;/SPAN&gt;&lt;SPAN class=""&gt;rohit&lt;/SPAN&gt;&lt;SPAN class=""&gt;\\&lt;/SPAN&gt;&lt;SPAN class=""&gt;AppData&lt;/SPAN&gt;&lt;SPAN class=""&gt;\\&lt;/SPAN&gt;&lt;SPAN class=""&gt;Local&lt;/SPAN&gt;&lt;SPAN class=""&gt;\\&lt;/SPAN&gt;&lt;SPAN class=""&gt;Temp&lt;/SPAN&gt;&lt;SPAN class=""&gt;\\&lt;/SPAN&gt;&lt;SPAN class=""&gt;AppTemplate.png&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&amp;nbsp;, however Notebook Server is not aware of the file system. I've attempted to write the binary to a Python tempfile (&lt;A href="https://docs.python.org/3/library/tempfile.html)," target="_blank" rel="noopener"&gt;https://docs.python.org/3/library/tempfile.html),&lt;/A&gt;&amp;nbsp;which successfully writes the file but, it's not usable as an attachment.&lt;/P&gt;&lt;P&gt;Notebook Server on AGOL throws an error of :&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Exception&lt;/SPAN&gt;: Unable to complete operation.
Adding of attachment failed.
(Error Code: 400)&lt;/PRE&gt;&lt;P&gt;Executing the &lt;SPAN&gt;on ArcGIS Python API&amp;nbsp;&lt;/SPAN&gt;on my local box returns an error of:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;[WinError 2] The system cannot find the file specified: 'C:\\Users\\XXXXXXX\\AppData\\Local\\Temp\\tmpikjawae3'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;tmpikjawae3 &lt;FONT color="#000000"&gt;is the name of the file in my temp directory&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;There are tons of other things I'd like to do: carve into text files, create attachments, connect with automations...&lt;/P&gt;&lt;P&gt;Is what I'm asking about possible?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 22:17:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/notebook-server-working-with-quot-local-quot/m-p/1099569#M31123</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2021-09-17T22:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Notebook Server: Working with "local" content.</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/notebook-server-working-with-quot-local-quot/m-p/1100299#M31136</link>
      <description>&lt;P&gt;Update:&lt;/P&gt;&lt;P&gt;I've accomplished this with the ArcGIS REST API and a POST and the &lt;STRONG&gt;import requests&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What I'd really like to do is use the Python API for ArcGIS: e.g., &lt;STRONG&gt;cr_lyr.attachments.add(1, 'C:\\Users\\rohit\\AppData\\Local\\Temp\\AppTemplate.png'&lt;/STRONG&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 14:26:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/notebook-server-working-with-quot-local-quot/m-p/1100299#M31136</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2021-09-21T14:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Notebook Server: Working with "local" content.</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/notebook-server-working-with-quot-local-quot/m-p/1104729#M31232</link>
      <description>&lt;P&gt;Since ArcGIS Notebook Server notebooks run in the context of a Linux container, the two approaches for making files available within the container are to upload to the user's workspace or mount a data directory for all users to access.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Work with content in the user workspace—ArcGIS Notebook Server | Documentation for ArcGIS Enterprise&lt;BR /&gt;&lt;A href="https://enterprise.arcgis.com/en/notebook/latest/use/windows/work-with-content-in-a-user-workspace.htm" target="_blank"&gt;https://enterprise.arcgis.com/en/notebook/latest/use/windows/work-with-content-in-a-user-workspace.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Configure ArcGIS Notebook Server directories—ArcGIS Notebook Server | Documentation for ArcGIS Enterprise&lt;BR /&gt;&lt;A href="https://enterprise.arcgis.com/en/notebook/latest/administer/linux/configure-and-manage-arcgis-notebook-server-directories.htm#ESRI_SECTION1_77CF490C030C4578BC8BB87869204E18" target="_blank"&gt;https://enterprise.arcgis.com/en/notebook/latest/administer/linux/configure-and-manage-arcgis-notebook-server-directories.htm#ESRI_SECTION1_77CF490C030C4578BC8BB87869204E18&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully that matches up with what you're trying to accomplish.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 13:18:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/notebook-server-working-with-quot-local-quot/m-p/1104729#M31232</guid>
      <dc:creator>ChristopherPawlyszyn</dc:creator>
      <dc:date>2021-10-05T13:18:03Z</dc:date>
    </item>
  </channel>
</rss>

