AnsweredAssumed Answered

Adding Attachments to Feature Layer in 4.x

Question asked by alindley on May 8, 2018

I'm trying to add an attachment (pdf/jpeg/etc.) to a feature in a feature service via the rest endpoint's /addAttachment or updateAttachment method, and I can't seem to figure it out. 


I'm creating a formData object and passing in the file I want to upload, and sending that to the /addAttachment url via a POST request, but I keep getting an error that the operation is not supported by the layer. The hasAttachments property of the layer is 'true', and it has add/update capability enabled, so I am able to add an attachment from the REST endpoint itself, but not from an ajax request in my app.


Anyone have an example of how to do this, or any insight into where I might be going wrong?