<?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 Feature attachment for large file returns 500 error in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-attachment-for-large-file-returns-500/m-p/1703753#M88471</link>
    <description>&lt;P&gt;I have ArcGIS Server 11.5 with the following configuration:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Setver setup.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152875i4EC063F7FFCC2BD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Setver setup.png" alt="Setver setup.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can upload feature attachments (up to 20MB) using the following function called popup action.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="popup action.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152874iD3ADF610E0B63AE3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="popup action.png" alt="popup action.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function is:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    function _addAttachment(feature: any) {
        //create form
        const attachmentForm = document.createElement("form");
        attachmentForm.setAttribute("id", "attachmentForm");
        let fileSelector = document.createElement("input");
        fileSelector.setAttribute("id", "fileInput");
        fileSelector.setAttribute("type", "file");
        fileSelector.setAttribute("name", "attachment");
        fileSelector.setAttribute("accept", "image/*,video/*,application/pdf");
        let entInput = document.createElement("input");
        entInput.setAttribute("name", "f");
        entInput.setAttribute("value", "json");
        attachmentForm.appendChild(fileSelector);
        attachmentForm.appendChild(entInput);
        document.body.appendChild(attachmentForm);
        document.getElementById('fileInput')?.addEventListener("change", (e) =&amp;gt; {
            let uploadedFile = (e.target as any).files[0];
            if (!uploadedFile) {
                let message = "No file has been selected.";
                (document.getElementById("calcite-error-content") as any).innerHTML = message;
                (document.getElementById("calcite-error-modal") as any).open = true;
                return;
            }
            const formData = new FormData(attachmentForm);
            console.log(formData);
            // The attachment is taken from the form.
            feature.layer.addAttachment(feature, formData).then((result: any) =&amp;gt; {
                if (result.error === null) {
                    alert("Attachment has been successfully uploaded.");
                }
                //delete form node
                document.body.removeChild(document.getElementById("attachmentForm") as any);
            }).catch((error:any) =&amp;gt; {
                //delete form node
                document.body.removeChild(document.getElementById("attachmentForm") as any);
                console.log("attachment adding failed: ", error);
                alert("Attachment upload has failed.");
            });
        });
        document.getElementById('fileInput')?.click();
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried for file size of 170MB and fails with 500 error code.&lt;/P&gt;&lt;DIV&gt;Interestingly, I can upload this using fearureTable add attachment.&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ft attachment.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152876i2A1F2C4F68CE3378/image-size/large?v=v2&amp;amp;px=999" role="button" title="ft attachment.png" alt="ft attachment.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;I appreciate for any work aroun&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Fri, 22 May 2026 11:24:46 GMT</pubDate>
    <dc:creator>MKY</dc:creator>
    <dc:date>2026-05-22T11:24:46Z</dc:date>
    <item>
      <title>Feature attachment for large file returns 500 error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-attachment-for-large-file-returns-500/m-p/1703753#M88471</link>
      <description>&lt;P&gt;I have ArcGIS Server 11.5 with the following configuration:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Setver setup.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152875i4EC063F7FFCC2BD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Setver setup.png" alt="Setver setup.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can upload feature attachments (up to 20MB) using the following function called popup action.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="popup action.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152874iD3ADF610E0B63AE3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="popup action.png" alt="popup action.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function is:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    function _addAttachment(feature: any) {
        //create form
        const attachmentForm = document.createElement("form");
        attachmentForm.setAttribute("id", "attachmentForm");
        let fileSelector = document.createElement("input");
        fileSelector.setAttribute("id", "fileInput");
        fileSelector.setAttribute("type", "file");
        fileSelector.setAttribute("name", "attachment");
        fileSelector.setAttribute("accept", "image/*,video/*,application/pdf");
        let entInput = document.createElement("input");
        entInput.setAttribute("name", "f");
        entInput.setAttribute("value", "json");
        attachmentForm.appendChild(fileSelector);
        attachmentForm.appendChild(entInput);
        document.body.appendChild(attachmentForm);
        document.getElementById('fileInput')?.addEventListener("change", (e) =&amp;gt; {
            let uploadedFile = (e.target as any).files[0];
            if (!uploadedFile) {
                let message = "No file has been selected.";
                (document.getElementById("calcite-error-content") as any).innerHTML = message;
                (document.getElementById("calcite-error-modal") as any).open = true;
                return;
            }
            const formData = new FormData(attachmentForm);
            console.log(formData);
            // The attachment is taken from the form.
            feature.layer.addAttachment(feature, formData).then((result: any) =&amp;gt; {
                if (result.error === null) {
                    alert("Attachment has been successfully uploaded.");
                }
                //delete form node
                document.body.removeChild(document.getElementById("attachmentForm") as any);
            }).catch((error:any) =&amp;gt; {
                //delete form node
                document.body.removeChild(document.getElementById("attachmentForm") as any);
                console.log("attachment adding failed: ", error);
                alert("Attachment upload has failed.");
            });
        });
        document.getElementById('fileInput')?.click();
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried for file size of 170MB and fails with 500 error code.&lt;/P&gt;&lt;DIV&gt;Interestingly, I can upload this using fearureTable add attachment.&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ft attachment.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152876i2A1F2C4F68CE3378/image-size/large?v=v2&amp;amp;px=999" role="button" title="ft attachment.png" alt="ft attachment.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;I appreciate for any work aroun&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 May 2026 11:24:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-attachment-for-large-file-returns-500/m-p/1703753#M88471</guid>
      <dc:creator>MKY</dc:creator>
      <dc:date>2026-05-22T11:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Feature attachment for large file returns 500 error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-attachment-for-large-file-returns-500/m-p/1704578#M88479</link>
      <description>&lt;P&gt;Error in my IIS setup of&amp;nbsp;maxAllowedContentLength. increased to 2GB and works fine&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2026 10:50:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-attachment-for-large-file-returns-500/m-p/1704578#M88479</guid>
      <dc:creator>MKY</dc:creator>
      <dc:date>2026-05-27T10:50:53Z</dc:date>
    </item>
  </channel>
</rss>

