<?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: How I can save a file into BLOB field? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618637#M57843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 May 2017 23:30:45 GMT</pubDate>
    <dc:creator>DairisTapanes_Rios</dc:creator>
    <dc:date>2017-05-05T23:30:45Z</dc:date>
    <item>
      <title>How I can save a file into BLOB field?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618633#M57839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to do something like when you enable attachments, but I need to have more control over the attachment table , so I created the attachment table that contain the attachment files and more attributes and&amp;nbsp;I want use&amp;nbsp;&lt;SPAN style="color: #3d3d3d;"&gt;&amp;nbsp;applyEdits to add and edit features. I'm wondering how &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt;I&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt;&amp;nbsp;can insert&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt;a file chosen&amp;nbsp;by the client into the BLOB field, please any idea would be great!!s&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d;"&gt;Dairis&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 06:50:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618633#M57839</guid>
      <dc:creator>DairisTapanes_Rios</dc:creator>
      <dc:date>2017-05-04T06:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: How I can save a file into BLOB field?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618634#M57840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just making sure, is this is a JavaScript app? And, are you programmatically making your own ArcGIS REST API calls for editing attachments in a feature service?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, then attachments are handled using &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Add_Attachment/02r3000000wt000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;addAttachment&lt;/A&gt;, &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Update_Attachment/02r3000000zz000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;updateAttachment&lt;/A&gt; and &lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Delete_Attachments/02r3000000t6000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;deleteAttachments&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With respect to your attachments, when you do add an attachment I recommend using&amp;nbsp;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/FormData" rel="nofollow noopener noreferrer" target="_blank"&gt;FormData&lt;/A&gt;&amp;nbsp;to create your XMLHttpRequest:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// Example when adding an attachment&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; formData &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;FormData&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; formData&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;append&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"attachment"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;file&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;// Example when updating an attachment&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; formData&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;append&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"attachmentId"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; attachment&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see an example of working with attachments using the ArcGIS JavaScript API and the attachment widget here:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/samples/ed_attachments/" title="https://developers.arcgis.com/javascript/3/samples/ed_attachments/" rel="nofollow noopener noreferrer" target="_blank"&gt;SanFrancisco311 - Incidents&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of the HTTP request when making an addAttachment. You can see this for yourself in the browser's developer tools under the network tab.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;WebKitFormBoundary1aQsyoAkAGZU7oKM Content&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Disposition&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; form&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; name&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"attachment"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; filename&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Blue Lake.jpg"&lt;/SPAN&gt; Content&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Type&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; image&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;jpeg 

&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;WebKitFormBoundary1aQsyoAkAGZU7oKM Content&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;Disposition&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; form&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; name&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"f"&lt;/SPAN&gt; json 
&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;--&lt;/SPAN&gt;WebKitFormBoundary1aQsyoAkAGZU7oKM&lt;SPAN class="operator token"&gt;--&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a request is successful you'll see a response in the network tab similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="string token"&gt;"addAttachmentResult"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"objectId"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;7369&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"globalId"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;"success"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:25:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618634#M57840</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-12-12T02:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: How I can save a file into BLOB field?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618635#M57841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andy,&lt;/P&gt;&lt;P&gt;Thank you for you quickly answer.&lt;/P&gt;&lt;P&gt;Sorry if I don't explain me very well .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, it is a JavaScript app but I don't want to enable attachments on the features classes because same document could be attachment to different features classes.&lt;/P&gt;&lt;P&gt;Then&amp;nbsp;I come with the &amp;nbsp;idea to create a table that contain all the documents and create a relationship N:M to the different features classes that will have associated those attachments.&lt;/P&gt;&lt;P&gt;In that case I can't use&amp;nbsp;&lt;A href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fresources.arcgis.com%2Fen%2Fhelp%2Farcgis-rest-api%2F%23%2FAdd_Attachment%2F02r3000000wt000000%2F" rel="nofollow" style="color: #287433; border: 0px; font-weight: inherit; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;addAttachment&lt;/A&gt;&lt;SPAN style="background-color: #ffffff;"&gt;, &lt;/SPAN&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fresources.arcgis.com%2Fen%2Fhelp%2Farcgis-rest-api%2F%23%2FUpdate_Attachment%2F02r3000000zz000000%2F" rel="nofollow" style="color: #287433; border: 0px; font-weight: inherit; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;updateAttachment&lt;/A&gt;&lt;SPAN style="background-color: #ffffff;"&gt; and &lt;/SPAN&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fresources.arcgis.com%2Fen%2Fhelp%2Farcgis-rest-api%2F%23%2FDelete_Attachments%2F02r3000000t6000000%2F" rel="nofollow" style="color: #287433; border: 0px; font-weight: inherit; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;deleteAttachments&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is why I'm wondering how to insert a BLOB field on ArcGIS Server Rest API, I read that&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;"the ArcGIS Server REST API does not support BLOBs", is it true ? if so, &amp;nbsp;what I can do ? Could you give better idea to handle that ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Dairis&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 style="background-color: #ffffff; border: 0px; font-weight: 200; font-size: 2rem;"&gt;&lt;/H1&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 21:15:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618635#M57841</guid>
      <dc:creator>DairisTapanes_Rios</dc:creator>
      <dc:date>2017-05-05T21:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: How I can save a file into BLOB field?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618636#M57842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct, there is no support for BLOBs, reference:&amp;nbsp;&lt;A class="link-titled" href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Feature_object/02r3000000n8000000/" title="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Feature_object/02r3000000n8000000/"&gt;ArcGIS REST API&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feature object attributes are stored in JSON. Field values can be string, number or&amp;nbsp;boolean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Andy&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 21:58:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618636#M57842</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2017-05-05T21:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: How I can save a file into BLOB field?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618637#M57843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 23:30:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-i-can-save-a-file-into-blob-field/m-p/618637#M57843</guid>
      <dc:creator>DairisTapanes_Rios</dc:creator>
      <dc:date>2017-05-05T23:30:45Z</dc:date>
    </item>
  </channel>
</rss>

