applyEdits with attachments - uploadId error

108
0
2 weeks ago
KamilNovák
New Contributor III

Hello,

I have created my applyEdits() method. Its logic aligns with the following:

 

featureForSend.setAttribute("globalid", "{3b0931f2-78f6-4799-ae0f-13d26c787775}");
EditLayer.applyEdits({
  addFeatures: [featureForSend], 
  addAttachments: [{
     feature: featureForSend,
     attachment: {
        globalId: "{b99a53f2-3b76-4024-97d2-8ceca8b624ae}",
        data: input.files[0]
     }
   }]
}, {gdbVersion: "", 
    returnEditMoment: false, 
    globalIdUsed: true, 
    rollbackOnFailureEnabled: false
}).then((result) => {...

 

 This code fires HTTP request with this data:

 

Adds:
[{"geometry":{"spatialReference":{"latestWkid":5514,"wkid":102067},"x":-8988283.904533692,"y":4133042.200104993},"attributes":{"poznamka": "test", "globalid":"{3b0931f2-78f6-4799-ae0f-13d26c787775}"}}]

Attachments:
{"adds":[{"globalId":"{b99a53f2-3b76-4024-97d2-8ceca8b624ae}","parentGlobalId":"{3b0931f2-78f6-4799-ae0f-13d26c787775}","contentType":"image/png","name":"Image 001.png","uploadId":null,"data":"loremipsum"}],"updates":[],"deletes":[]}

 

... and it ends with server error "Unable to complete operation. Unable to perform applyEdits operation. An error occurred."

I’ve discovered an issue related to the "uploadId":null parameter (in Attachments data). When I remove this parametr and re-run this request again (directly in REST API), the request succeeds

However I'm not able to achieve the same result using the ArcGIS Maps SDK fo JavaScript. JS API always adds this "uploadId":null param to the HTTP request.

Is there a solution for this?  We have federated Enterprise 10.9.1 and JS API 4.27.

Thanks

0 Kudos
0 Replies