AnsweredAssumed Answered

addAttachment on secure service using proxy returns 500 internal server error

Question asked by katroyer on May 17, 2016
Latest reply on May 18, 2016 by katroyer

If I use an non-secured feature service, it does not use the proxy and I have no problem uploading an attachment.  As soon as I use a secure feature service, I get 500 internal server error.  I'm at a complete loss.  I've called support and they are researching it.  It seems to be a problem with the proxy, possibly in how I've set it up, but I can't figure it out.  Using the dotnet proxy from esri's github. 

code below works if my service is not secure, but the fLayer I've plugged in here is secure and I get the 500 error.  Server 10.3.1, Javascript 3.13

 

html:

                   
   

 

javascript:

require(["esri/config","esri/dijit/editing/Add", 
"esri/layers/FeatureLayer", "esri/urlUtils","dojo/dom",  "dojo/on", 
"dojo/domReady!"


], function (esriConfig, Add, FeatureLayer, urlUtils, dom, on){

    "use strict";
    

    urlUtils.addProxyRule({
                urlPrefix: "https://gis.northcharleston.org/arcgis/rest/services/Feature/OneStopShop/FeatureServer/", 
                proxyUrl:"https://gis.northcharleston.org/DotNet/proxy.ashx"
            });
    
    on(dom.byId("submitButton"), "click", uploadFile);
    
    function uploadFile(){
        var fLayer=new FeatureLayer("https://gis.northcharleston.org/arcgis/rest/services/Feature/OneStopShop/FeatureServer/0");
        fLayer.addAttachment(24404, document.getElementById("attachOne"), function(result){console.log(result);}, function(errorMessage){console.log(errorMessage);});
        
    }
    
    
, function(errorMessage){console.log(errorMessage);});
        
    }
    

Outcomes