Add Shapefile error in IE

3522
7
06-20-2013 12:16 PM
RobertWinterbottom
Occasional Contributor
So I am having some trouble uploading a shapefile in IE9.  I was able to get it working in Chrome, Safari, and FF. 

In IE9 at first it was failing giving me an access denied error, so I pointed the app to my local php proxy and added the url in the serverURL's array and I got past this part.  But now I am getting an error stating 'Unable to get value of the property 'value'. object is null or undefined'.

As far as I can tell I am getting all the way to esri.request and then that is where the error is happening.  My code is pretty much the same thing as the sample code but just in case, here is the esri.request code

esri.request({
  url: portalURL+"/sharing/rest/content/features/generate",
  content: myContent,
  form: dom.byId("uploadForm"),
  handleAs: 'json',
  load:lang.hitch(this,function(response){
    if(response.error){
      _self._uploadErrorHandler(response.error);
      return;
    }
    dom.byId("upload-status").innerHTML = "<p style='color:#0F0'>Loaded: "+response.featureCollection.layers[0].layerDefinition.name+"</p>";
    _self._addShapeFileToMap(response.featureCollection);

  }),
  error: lang.hitch(this,_self._uploadErrorHandler)
});


Edit: I noticed when logging the error to the console in IE, the only two things I found that were null or undefined so far are in the error object, error._ssl is undefined and error.response.options.query is null
0 Kudos
7 Replies
RobertWinterbottom
Occasional Contributor
Anyone have any ideas for this one?  I noticed the code sample under portal > add shape file works in IE9 so I am not sure if this is an error on client side or if I need to configure the proxy a special way, any help or even a point in the right direction would be helpful, can post code if needed.
0 Kudos
ShaunWeston
Occasional Contributor
Did you ever figure this one out?
0 Kudos
JohnGravois
Frequent Contributor
do you see a request to http://arcgis.com/sharing/rest/content/features/generate?  is it using your proxy?  are JSON features included in the response?
0 Kudos
ShaunWeston
Occasional Contributor
Ok so I've got the app setup on my machine to upload a shapefile and if I have the proxy setup on a web server on my machine like this - http://localhost/proxy/proxy.ashx

I
can see this request made: http://localhost/proxy/proxy.ashx?http://www.arcgis.com/sharing/rest/content/features/generate

A
nd this returned:
[h=3]HTTP Error 405.0 - Method Not Allowed[h=4]The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.

If I setup the proxy on another web server e.g. http://maps.splicegroup.co.nz/proxy/proxy.ashx

I
can see this request made: http://maps.splicegroup.co.nz/proxy/proxy.ashx?http://www.arcgis.com/sharing/rest/content/features/g...

nd this returned:

{"featureCollection":{"layers":[{"layerDefinition":{"currentVersion":10.11,"id":0,"name":"KCDCRailLineNZTM","type":"Feature Layer","displayField":"","description":"","copyrightText":"","defaultVisibility":true,"relationships":[],"isDataVersioned":false,"supportsRollbackOnFailureParameter":true,"supportsStatistics":true,"supportsAdvancedQueries":true,"geometryType":"esriGeometryPolyline","minScale":0,"maxScale":0,"extent":{"xmin":1762488.574,"ymin":5459004.3787,"xmax":1786182.0569000002,"ymax":5488679.234,"spatialReference":{"wkid":2193,"latestWkid":2193}},"drawingInfo":{"renderer":{"type":"simple","symbol":{"type":"esriSLS","style":"esriSLSSolid","color":[165,83,183,255],"width":1},"label":"","description":""},"transparency":0,"labelingInfo":null},"allowGeometryUpdates":true,"hasAttachments":false,"htmlPopupType":"","hasM":false,"hasZ":false,"objectIdField":"FID","globalIdField":"","typeIdField":"","fields":[{"name":"FID","type":"esriFieldTypeInteger","alias":"FID","sqlType":"sqlTypeOther","nullable":false,"editable":false,"domain":null,"defaultValue":null},{"name":"TYPE","type":"esriFieldTypeString","alias":"TYPE","sqlType":"sqlTypeOther","length":6,"nullable":true,"editable":true,"domain":null,"defaultValue":null},{"name":"Shape_Leng","type":"esriFieldTypeDouble","alias":"Shape_Leng","sqlType":"sqlTypeOther","nullable":true,"editable":true,"domain":null,"defaultValue":null}],"indexes":[],"types":[],"templates":[{"name":"New Feature","description":"","drawingTool":"esriFeatureEditToolLine","prototype":{"attributes":{"TYPE":null,"Shape_Leng":null}}}],"supportedQueryFormats":"JSON","hasStaticData":false,"maxRecordCount":-1,"capabilities":"Create,Delete,Query,Update,Editing"},"featureSet":{"features":[{"attributes":{"FID":0,"TYPE":"Rail","Shape_Leng":4212.95219012},"geometry":{"spatialReference":{"wkid":2193,"latestWkid":2193},"paths":[[[1781396,5484985],[1782264,5485452],[1782344,5485517],[1782381,5485570],[1782417,5485722],[1782396,5486084],[1782409,5486223],[1782433,5486309],[1782553,5486544],[1782799,5487712],[1782856,5487778],[1783397,5488046],[1783504,5488160]]]}},{"attributes":{"FID":1,"TYPE":"Rail","Shape_Leng":6900.55015486},"geometry":{"spatialReference":{"wkid":2193,"latestWkid":2193},"paths":[[[1776830,5478280],[1777186,5478849],[1777256,5478932],[1777371,5479008],[1777568,5479053],[1777668,5479100],[1777753,5479163],[1777854,5479283],[1780767,5483836]]]}},{"attributes":{"FID":2,"TYPE":"Rail","Shape_Leng":1324.00999498},"geometry":{"spatialReference":{"wkid":2193,"latestWkid":2193},"paths":[[[1781396,5484985],[1781293,5484893],[1781220,5484787],[1781062,5484362],[1780940,5484119],[1780767,5483836]]]}},{"attributes":{"FID":3,"TYPE":"Rail","Shape_Leng":3087.24024535},"geometry":{"spatialReference":{"wkid":2193,"latestWkid":2193},"paths":[[[1783504,5488160],[1783576,5488204],[1783794,5488208],[1783888,5488271],[1783936,5488348],[1783939,5488483],[1783957,5488541],[1783988,5488587],[1784096,5488649],[1784222,5488641],[1784365,5488538],[1784405,5488526],[1784492,5488539],[1784692,5488623],[1784850,5488631],[1785125,5488571],[1785513,5488566],[1785780,5488516],[1785906,5488530],[1786021,5488571],[1786109,5488617],[1786182,5488679]]]}},{"attributes":{"FID":4,"TYPE":"Rail","Shape_Leng":25432.8696328},"geometry":{"spatialReference":{"wkid":2193,"latestWkid":2193},"paths":[[[1776830,5478280],[1776216,5477290],[1775746,5476432],[1775728,5476326],[1775748,5475621],[1775737,5475540],[1775694,5475429],[1774912,5474154],[1774055,5472814],[1773975,5472646],[1773952,5472414],[1773914,5472329],[1773822,5472224],[1773765,5472188],[1773186,5472009],[1772581,5471780],[1772282,5471722],[1771871,5471745],[1771681,5471719],[1771463,5471647],[1771218,5471492],[1770988,5471256],[1770587,5470794],[1768744,5468136],[1768401,5467599],[1768304,5467400],[1767899,5466136],[1767682,5465519],[1767348,5464230],[1767163,5463155],[1767124,5462996],[1767090,5462926],[1766982,5462805],[1766767,5462630],[1765034,5461350],[1764743,5461093],[1764129,5460611],[1763967,5460454],[1763859,5460316],[1763602,5459865],[1763433,5459655],[1763231,5459486],[1762609,5459070],[1762489,5459004]]]}}],"geometryType":"esriGeometryPolyline"}}],"showLegend":true}}



However in my application I get an error: "Permission denied"

If I try the upload shapefile app in any other browser apart from IE8 or IE9 it works fine as it doesn't use the proxy page.

So just a bit confused how to setup the proxy page?
0 Kudos
ShaunWeston
Occasional Contributor
Ok noticed the sample here - http://developers.arcgis.com/en/javascript/samples/portal_addshapefile/

Works in IE9 and the request made is - http://developers.arcgis.com/proxy?http://www.arcgis.com/sharing/rest/content/features/generate

So I guess the application and the proxy need to be on the same server?
0 Kudos
JohnGravois
Frequent Contributor
0 Kudos
DavidStajan
New Contributor III
I'm getting this error when trying to use my own install of Portal for ArcGIS to create the shapefile.

"Generate Features error: Unable to determine hosted server's instance URL (no hosted server configured?)."

Anyone know what might be wrong.  Is there any documentation on how to set up the Generate Operation in Portal?

Thanks,
David
0 Kudos