Adding Lg. Attachment via REST

121
0
09-13-2019 10:06 AM
danbecker
Regular Contributor

I'd like to use the JS API to upload feature attachment >10MB in size, which I understand 10MB is the file size limit in the JS API. So, it looks like you can upload them using the REST API.

Upload the file to ArcGIS Server, something like:

var gp = New Geoprocessor({

  url: https://<service-url>/uploads/upload

});

var sendFile = gp.execute({

   file: 'fromBrowser.pdf',

   f: 'json'

});

You then get an Item ID of that uploaded file, something like:

sendFile.then(function(response){

   var urlToFile = 'https://<service-url>/uploads/' + response.itemID;

   ...

})

From this point, how do you attach the file (that now resides on the ArcGIS Server) to a feature using?

https://<service-url>/addAttachment

Can REST API addAttachment, attachment parameter be a URL?

0 Kudos
0 Replies