<?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: 'file' -  ArcGIS REST API - For ArcGIS Online in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/file-arcgis-rest-api-for-arcgis-online/m-p/476845#M2281</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to figure this out.. It was not as simple as I expected but it can be done.&lt;/P&gt;&lt;P&gt;Basically I had to create a Multipart Form Post in .NET&lt;/P&gt;&lt;P&gt;There is a nice C# Class someone wrote to assist with this here: &lt;A href="http://www.briangrinstead.com/blog/multipart-form-post-in-c" title="http://www.briangrinstead.com/blog/multipart-form-post-in-c"&gt;Multipart Form Post in C# - Brian Grinstead&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Oct 2014 15:02:29 GMT</pubDate>
    <dc:creator>Drew</dc:creator>
    <dc:date>2014-10-07T15:02:29Z</dc:date>
    <item>
      <title>'file' -  ArcGIS REST API - For ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/file-arcgis-rest-api-for-arcgis-online/m-p/476844#M2280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attempting to use the REST API for ArcGIS Online.&lt;/P&gt;&lt;P&gt;I have been successful in adding some general items through code, but I would like to now upload a map package using the API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the '&lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Add_Item/02r30000008q000000/"&gt;AddItem&lt;/A&gt;' function and am applying the '&lt;STRONG&gt;file&lt;/STRONG&gt;' parameter in my POST request (I also make it multipart)&lt;/P&gt;&lt;P&gt;What I am wondering what do I pass as a value for the '&lt;STRONG&gt;file&lt;/STRONG&gt;' parameter when trying to upload a file such as a map package?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I pass a local path: c:\temp\test.mpk&lt;/P&gt;&lt;P&gt;Do I pass a Base64 string ?&lt;/P&gt;&lt;P&gt;Do I pass some sort of byte array?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried many different methods, but none are working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas would be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 19:29:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/file-arcgis-rest-api-for-arcgis-online/m-p/476844#M2280</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2014-10-06T19:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: 'file' -  ArcGIS REST API - For ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/file-arcgis-rest-api-for-arcgis-online/m-p/476845#M2281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to figure this out.. It was not as simple as I expected but it can be done.&lt;/P&gt;&lt;P&gt;Basically I had to create a Multipart Form Post in .NET&lt;/P&gt;&lt;P&gt;There is a nice C# Class someone wrote to assist with this here: &lt;A href="http://www.briangrinstead.com/blog/multipart-form-post-in-c" title="http://www.briangrinstead.com/blog/multipart-form-post-in-c"&gt;Multipart Form Post in C# - Brian Grinstead&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 15:02:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/file-arcgis-rest-api-for-arcgis-online/m-p/476845#M2281</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2014-10-07T15:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: 'file' -  ArcGIS REST API - For ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/file-arcgis-rest-api-for-arcgis-online/m-p/476846#M2282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In non-GIS file via form, you send a file like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;form action="/upload" enctype="multipart/form-data" method="post" accept="image/*;caputre=camera"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;input type="file" name="upload" multiple="multiple"&amp;gt;&amp;lt;br&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;input type="submit" value="Upload"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/form&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a sample I use for sending images from a computer to the server or opening the camera on a cell phone(so you probably don't need the accept= part unless you want to filter allowed filetype). The server should already be setup to handle the upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The link you posted says you can upload a zip or map package&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;Zip file (*.mpk, *.lpk)&lt;BR /&gt; |-- esriinfo (folder)&lt;BR /&gt;&amp;nbsp; |-- iteminfo.xml (item card)&lt;BR /&gt;&amp;nbsp; |-- subfolder&lt;BR /&gt;&amp;nbsp; |-- thumbnail.jpg&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 16:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/file-arcgis-rest-api-for-arcgis-online/m-p/476846#M2282</guid>
      <dc:creator>PaulCrickard1</dc:creator>
      <dc:date>2014-10-07T16:46:12Z</dc:date>
    </item>
  </channel>
</rss>

