Hi all,I�??m working on a geoprocessing script that uploads a jpg from a local drive to a feature service.I�??m having troubles getting the operation syntax right for posting the �??addAttachment�?? request to the Server.Link to online resources:http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Add_Attachment/02r3000000wt000000/I�??ve tried the following:1) addAttachment via the ArcGIS server web browser interface (WORKING)response:{"addAttachmentResult":{"objectId":2001,"success":true}}2) I tried to replicate #1 by entering the following request into the URL bar in a web browser (NOT WORKING):http://<my-server>/arcgis/rest/services/GeoProcessing_tools/Milling_Statement_points/FeatureServer/0/1602/addAttachment?f=json&attachment=C:\TEMP\pic00002.jpgresponse:{"error":{"code":500,"message":"java.lang.String cannot be cast to com.esri.arcgis.discovery.json.JSONObject","details":[]}}My attachment parameter is obviously not correct. What would be the correct syntax?The online resources�?? only info on this was: �??The input parameter attachment to this operation is a file.�?�3) Lastly, I tried to post the information as part of my python script using urllib (NOT WORKING):
Import urllib
url=�?? http://<my-server>/arcgis/rest/services/GeoProcessing_tools/Milling_Statement_points/FeatureServer/0/1602/addAttachment�??
payload = {'f':'json', 'attachment':{'url': r'file:///C:/TEMP/pic00002.jpg', 'contentType' : 'image/jpg'}}
response = urllib.urlopen(url, urllib.urlencode(payload)).read()
print response
{"error":{"code":500,"message":"JSONObject[\"uploadedFilePath\"] not found.","details":[]}}
Both error messages (2 & 3) include �?? �??code�?? : 500�?� which appears to point to a server-side problem.However, the addAttachment operation works when using the web browser interface (1). Does that not contradict a server-side issue?I�??d appreciate any help on this problem.Cheers,Katrin