<?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: Upload PNG image using /addItem in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/upload-png-image-using-additem/m-p/1480639#M39627</link>
    <description>&lt;P&gt;The 'file' parameter is of binary. Anyone know of a way to specify the value/content of this 'file' parameter?&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2024 00:18:01 GMT</pubDate>
    <dc:creator>freddies</dc:creator>
    <dc:date>2024-05-30T00:18:01Z</dc:date>
    <item>
      <title>Upload PNG image using /addItem</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/upload-png-image-using-additem/m-p/1319888#M36874</link>
      <description>&lt;P&gt;I am trying to upload a PNG file as an item to Portal using /&lt;SPAN&gt;addItem using python post calls.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What format should 'file' be? I have tried converting to a binary image (a whole series of 0's and 1's) and also tried the file path. The item is created but it is "empty".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I do this manually and look at the dev tools for the '/addItem' post, it is set as 'file: (binary)'. I am not sure how to create the '(binary)' file type using python.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help and code examples for this will be great, thanks very much.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards, Julian&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 21:41:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/upload-png-image-using-additem/m-p/1319888#M36874</guid>
      <dc:creator>julian_svcs</dc:creator>
      <dc:date>2023-08-17T21:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Upload PNG image using /addItem</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/upload-png-image-using-additem/m-p/1320176#M36878</link>
      <description>&lt;P&gt;Hey Jilian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the &lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/add-item.htm" target="_self"&gt;documentation&lt;/A&gt; I believe a file path should suffice. Hopefully some of the examples within this help.&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 16:24:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/upload-png-image-using-additem/m-p/1320176#M36878</guid>
      <dc:creator>David_McRitchie</dc:creator>
      <dc:date>2023-08-18T16:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Upload PNG image using /addItem</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/upload-png-image-using-additem/m-p/1320416#M36890</link>
      <description>&lt;P&gt;Hi Divid. That doesn't work. I tried the path to the file and also tried to convert the image to binary and use that. In both cases it creates the item but it is empty.&lt;/P&gt;&lt;P&gt;I had a look at that website you posted but I don't see where it specifies the file path for 'file' or see anything in the examples.&lt;/P&gt;&lt;P&gt;Here is my json for the data post request:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;logo_title = "Logo.png"
logo_path = r"c:\_scripts_\_scratch\{}".format(logo_title)
data_add_item = {
    "title": f"Shared Theme Logo - {os.path.splitext(logo_title)[0]}",
    "description": "This image was uploaded for use as your organization's shared theme logo.",
    "type": "Image",
    "tags": "SharedTheme, Logo",
    "f": "json", 
    "file": logo_path,
    "token": token
}&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 19 Aug 2023 20:23:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/upload-png-image-using-additem/m-p/1320416#M36890</guid>
      <dc:creator>julian_svcs</dc:creator>
      <dc:date>2023-08-19T20:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Upload PNG image using /addItem</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/upload-png-image-using-additem/m-p/1480639#M39627</link>
      <description>&lt;P&gt;The 'file' parameter is of binary. Anyone know of a way to specify the value/content of this 'file' parameter?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 00:18:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/upload-png-image-using-additem/m-p/1480639#M39627</guid>
      <dc:creator>freddies</dc:creator>
      <dc:date>2024-05-30T00:18:01Z</dc:date>
    </item>
  </channel>
</rss>

