<?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 problem with attachments via a proxy page in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-attachments-via-a-proxy-page/m-p/118891#M2843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a feature service being accessed via a proxy page so that it can be secured, and accessed using a dynamically generated token. (However, this problem appears to happen regardless of whether the service is secured - it's a proxy page issue).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the attachment inspector, out of the box in the Flex API. the problem is that new attachments do not hit the rest endpoint correctly. Instead of a standard response, I receive a string of HTML which represents the "Add Features" rest endpoint:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=7" /&amp;gt;
&amp;nbsp; &amp;lt;title&amp;gt;Add Attachment (Feature ID: 420)&amp;lt;/title&amp;gt;
&amp;nbsp; &amp;lt;link href='https://community.esri.com/ArcGIS/rest/ESRI.ArcGIS.Rest.css' rel='stylesheet' type='text/css'&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;table width="100%" id="userTable"&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td id="titlecell"&amp;gt;ArcGIS Services Directory&amp;lt;/td&amp;gt;
&amp;lt;td align="right"&amp;gt;
Logged in as: webapp | &amp;lt;a href="https://community.esri.com/ArcGIS/rest/logout"&amp;gt;Logout&amp;lt;/a&amp;gt;

 | &amp;lt;a href="https://46.137.26.209/ArcGIS/tokens/gettoken.html" target="_blank"&amp;gt;Get Token&amp;lt;/a&amp;gt;
&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;table id="navTable" width="100%"&amp;gt;
&amp;lt;tbody&amp;gt;
&amp;lt;tr valign="top"&amp;gt;
&amp;lt;td id="breadcrumbs"&amp;gt;
&amp;lt;a href="https://community.esri.com/ArcGIS/rest/services"&amp;gt;Home&amp;lt;/a&amp;gt; &amp;gt; &amp;lt;a href="https://community.esri.com/ArcGIS/rest/services/PointsEdit/FeatureServer"&amp;gt;PointsEdit (FeatureServer)&amp;lt;/a&amp;gt; &amp;gt; &amp;lt;a href="https://community.esri.com/ArcGIS/rest/services/PointsEdit/FeatureServer/0"&amp;gt;sde.DBO.WWTW_Points&amp;lt;/a&amp;gt; &amp;gt; &amp;lt;a href="https://community.esri.com/ArcGIS/rest/services/PointsEdit/FeatureServer/0/420"&amp;gt;420&amp;lt;/a&amp;gt; &amp;lt;/td&amp;gt;

&amp;lt;td align="right" id="help"&amp;gt;
&amp;lt;a href="http://46.51.162.119/ArcGIS/SDK/REST/servicesdirectory.html" target="_blank"&amp;gt;Help&amp;lt;/a&amp;gt; | &amp;lt;a href="?f=help" target="_blank"&amp;gt;API Reference&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/tbody&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;div class='restHeader'&amp;gt;
&amp;lt;h2&amp;gt;Add Attachment (Feature ID: 420)&amp;lt;/h2&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class='restBody'&amp;gt;
&amp;lt;i&amp;gt;
Note: This operation is only supported via POST
&amp;lt;/i&amp;gt;

&amp;lt;br/&amp;gt;
&amp;lt;br/&amp;gt;
&amp;lt;br/&amp;gt;
&amp;lt;form enctype='multipart/form-data' method='post' action='/arcgis/rest/services/PointsEdit/FeatureServer/0/420/addAttachment?token=IJusyJW5AYDMhkRGrCcqkOiv3GHwceQA0sRy_rwprgQ.'&amp;gt;
&amp;lt;table class='formTable'&amp;gt;
&amp;lt;tr valign='top'&amp;gt;
&amp;lt;td&amp;gt;
Attachment
&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;
&amp;lt;input type='file' name='attachment' /&amp;gt;
&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;
Format:&amp;lt;/td&amp;gt;

&amp;lt;td&amp;gt;
&amp;lt;select name="f"&amp;gt;
&amp;lt;option value='html'selected = "true"&amp;gt;HTML&amp;lt;/option&amp;gt;
&amp;lt;option value='pjson'&amp;gt;JSON&amp;lt;/option&amp;gt;
&amp;lt;/select&amp;gt;
&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan='2' align='left'&amp;gt;&amp;lt;input type='submit' value='Add Attachment' /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the POST which pushes an attachment to the endpoint is causing the service to respond with its HTML page prompt - as if the attachment data is not being delivered correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I remove the proxy page and route the request directly, everything works correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have stepped through the proxy page, and confirmed that the POST data does get transferred to the request to ArcGIS Server; it does seem to be pushing the bytestream across to the new request.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I noticed though that the content type on the new request (inside the proxy) is defined as "application/x-www-form-urlencoded". However, the original content type posted from the Flex application is "multipart/form-data". I wonder if this is the problem - as it's binary data we're trying to push up as an attachment. I have briefly tried changing this to multipart/form-data in the proxy, but this causes the connection to close prematurely and the service request fails. I havent figured out why.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any further guidance here? Is there a known issue where attachments cannot be added via a proxy page connection?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Mar 2011 17:30:37 GMT</pubDate>
    <dc:creator>MarkWells</dc:creator>
    <dc:date>2011-03-17T17:30:37Z</dc:date>
    <item>
      <title>problem with attachments via a proxy page</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-attachments-via-a-proxy-page/m-p/118891#M2843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a feature service being accessed via a proxy page so that it can be secured, and accessed using a dynamically generated token. (However, this problem appears to happen regardless of whether the service is secured - it's a proxy page issue).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the attachment inspector, out of the box in the Flex API. the problem is that new attachments do not hit the rest endpoint correctly. Instead of a standard response, I receive a string of HTML which represents the "Add Features" rest endpoint:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=7" /&amp;gt;
&amp;nbsp; &amp;lt;title&amp;gt;Add Attachment (Feature ID: 420)&amp;lt;/title&amp;gt;
&amp;nbsp; &amp;lt;link href='https://community.esri.com/ArcGIS/rest/ESRI.ArcGIS.Rest.css' rel='stylesheet' type='text/css'&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;table width="100%" id="userTable"&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td id="titlecell"&amp;gt;ArcGIS Services Directory&amp;lt;/td&amp;gt;
&amp;lt;td align="right"&amp;gt;
Logged in as: webapp | &amp;lt;a href="https://community.esri.com/ArcGIS/rest/logout"&amp;gt;Logout&amp;lt;/a&amp;gt;

 | &amp;lt;a href="https://46.137.26.209/ArcGIS/tokens/gettoken.html" target="_blank"&amp;gt;Get Token&amp;lt;/a&amp;gt;
&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;table id="navTable" width="100%"&amp;gt;
&amp;lt;tbody&amp;gt;
&amp;lt;tr valign="top"&amp;gt;
&amp;lt;td id="breadcrumbs"&amp;gt;
&amp;lt;a href="https://community.esri.com/ArcGIS/rest/services"&amp;gt;Home&amp;lt;/a&amp;gt; &amp;gt; &amp;lt;a href="https://community.esri.com/ArcGIS/rest/services/PointsEdit/FeatureServer"&amp;gt;PointsEdit (FeatureServer)&amp;lt;/a&amp;gt; &amp;gt; &amp;lt;a href="https://community.esri.com/ArcGIS/rest/services/PointsEdit/FeatureServer/0"&amp;gt;sde.DBO.WWTW_Points&amp;lt;/a&amp;gt; &amp;gt; &amp;lt;a href="https://community.esri.com/ArcGIS/rest/services/PointsEdit/FeatureServer/0/420"&amp;gt;420&amp;lt;/a&amp;gt; &amp;lt;/td&amp;gt;

&amp;lt;td align="right" id="help"&amp;gt;
&amp;lt;a href="http://46.51.162.119/ArcGIS/SDK/REST/servicesdirectory.html" target="_blank"&amp;gt;Help&amp;lt;/a&amp;gt; | &amp;lt;a href="?f=help" target="_blank"&amp;gt;API Reference&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/tbody&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;div class='restHeader'&amp;gt;
&amp;lt;h2&amp;gt;Add Attachment (Feature ID: 420)&amp;lt;/h2&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class='restBody'&amp;gt;
&amp;lt;i&amp;gt;
Note: This operation is only supported via POST
&amp;lt;/i&amp;gt;

&amp;lt;br/&amp;gt;
&amp;lt;br/&amp;gt;
&amp;lt;br/&amp;gt;
&amp;lt;form enctype='multipart/form-data' method='post' action='/arcgis/rest/services/PointsEdit/FeatureServer/0/420/addAttachment?token=IJusyJW5AYDMhkRGrCcqkOiv3GHwceQA0sRy_rwprgQ.'&amp;gt;
&amp;lt;table class='formTable'&amp;gt;
&amp;lt;tr valign='top'&amp;gt;
&amp;lt;td&amp;gt;
Attachment
&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;
&amp;lt;input type='file' name='attachment' /&amp;gt;
&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;
Format:&amp;lt;/td&amp;gt;

&amp;lt;td&amp;gt;
&amp;lt;select name="f"&amp;gt;
&amp;lt;option value='html'selected = "true"&amp;gt;HTML&amp;lt;/option&amp;gt;
&amp;lt;option value='pjson'&amp;gt;JSON&amp;lt;/option&amp;gt;
&amp;lt;/select&amp;gt;
&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan='2' align='left'&amp;gt;&amp;lt;input type='submit' value='Add Attachment' /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the POST which pushes an attachment to the endpoint is causing the service to respond with its HTML page prompt - as if the attachment data is not being delivered correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I remove the proxy page and route the request directly, everything works correctly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have stepped through the proxy page, and confirmed that the POST data does get transferred to the request to ArcGIS Server; it does seem to be pushing the bytestream across to the new request.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I noticed though that the content type on the new request (inside the proxy) is defined as "application/x-www-form-urlencoded". However, the original content type posted from the Flex application is "multipart/form-data". I wonder if this is the problem - as it's binary data we're trying to push up as an attachment. I have briefly tried changing this to multipart/form-data in the proxy, but this causes the connection to close prematurely and the service request fails. I havent figured out why.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any further guidance here? Is there a known issue where attachments cannot be added via a proxy page connection?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2011 17:30:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-attachments-via-a-proxy-page/m-p/118891#M2843</guid>
      <dc:creator>MarkWells</dc:creator>
      <dc:date>2011-03-17T17:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: problem with attachments via a proxy page</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-attachments-via-a-proxy-page/m-p/118892#M2844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you using the proxy code from &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/help/content/proxy.htm"&gt;http://help.arcgis.com/en/webapi/flex/help/content/proxy.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These do pass through the "Content-Type".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2011 18:17:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-attachments-via-a-proxy-page/m-p/118892#M2844</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2011-03-17T18:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: problem with attachments via a proxy page</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-attachments-via-a-proxy-page/m-p/118893#M2845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dasa,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you! This appears to have solved it. I must have been using an older version of the proxy code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2011 09:37:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-attachments-via-a-proxy-page/m-p/118893#M2845</guid>
      <dc:creator>MarkWells</dc:creator>
      <dc:date>2011-03-18T09:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: problem with attachments via a proxy page</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-attachments-via-a-proxy-page/m-p/118894#M2846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been struggling with this for ages&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you use the new proxy page from flex API help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;namely &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/flex/help/index.html#/Using_the_proxy_page/017p0000000v000000/"&gt;http://help.arcgis.com/en/webapi/flex/help/index.html#/Using_the_proxy_page/017p0000000v000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it asks for the proxy page info ( passwords etc) to be included in appsettings tag of webconfig.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know the syntax i should use , i have tried a lot of variations and if i put anything in that tag my application throws a gen 500 error (get nothing at all) and if i remove tag i get application with no secured services ( i.e proxy page is not reachable) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any ideas&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 05:55:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/problem-with-attachments-via-a-proxy-page/m-p/118894#M2846</guid>
      <dc:creator>AHay</dc:creator>
      <dc:date>2011-09-07T05:55:51Z</dc:date>
    </item>
  </channel>
</rss>

