I thought I had seen the last of these. However, I am trying to retrieve the EXIF metadata of attached images using this code jseidelin/exif-js · GitHub - it works when I run the example page and load in the full URL of the images returned via a " featureLayer.queryAttachmentInfos" command.
However, the AGS server being a different domain to my site hits CORS issues - which I thought I had sorted by changes to web.config and adding the server name in with a "esri.config.defaults.io.corsEnabledServers.push"
However, when I try to retrieve the data using a simple function
for (index = 0; index < attachmentPath.length; ++index) {
var image = new Image();
image.src = attachmentPath[index];
image.onload = function () { // always fires the event.
EXIF.getData(this, function () {
console.debug(this)
var make = EXIF.getTag(this, "Make"),
model = EXIF.getTag(this, "Model");
alert("I was taken by a " + make + " " + model);
});
};
....do stuff with the info returned
}
I get
XMLHttpRequest cannot load http://<<server name>>/arcgis/rest/services/test/emap2/MapServer/22/2009/attachments/8. Request header field If-Modified-Since is not allowed by Access-Control-Allow-Headers.
All other requests to resources using the server name seem fine.
I'm stumped. All I want to do is to know which way up to display the attachments!