Add Attachments via python / service

2217
11
02-04-2020 12:39 PM
jaykapalczynski
Frequent Contributor

I am trying to research how to add attachments via Python.

I see something about Generating an Attachment Match Table and then Add Attachment.

I eventually want to run this python script via a service

Can I pass the service the local parameters to the image, identify the gdb etc from a mobile environment??? 

Where does this Match table come into play?  Would it reside on the mobile device?  PC?  Server?

I am not sure how this all plays together?

0 Kudos
11 Replies
jaykapalczynski
Frequent Contributor

Not sure if I can do this....I would have to pass the image to the server...not sure how to do that....

Any thoughts would be appreciated.

0 Kudos
DavidPike
MVP Frequent Contributor

Hi Jay,

What exactly do you want to do?

0 Kudos
jaykapalczynski
Frequent Contributor

I would like to take a pic on my phone and store that pic on the phone.

Then fire off a GPService that is running a python script that adds the image to a Geodatabase.

So I would have to upload the image and add it to a geodatabase.

I would have the Features Global ID and Object ID

I would have the image

I just need to pass the image somehow and Add the Attachment to the gdb

0 Kudos
DavidPike
MVP Frequent Contributor

Oh cool. If your gdb is in your data store you should be able to write straight into it. The gp service you create should have 'allow uploads ticked' which should allow you to specify the path from your phone. This is from a portal perspective unfortunately tho.

0 Kudos
jaykapalczynski
Frequent Contributor

My Service is in ArcGIS Server not portal....can I still do this?

0 Kudos
jaykapalczynski
Frequent Contributor

Do I have to create a Match Table?

0 Kudos
DavidPike
MVP Frequent Contributor

I'm straying out of my comfort zone, but I would think you specify the match table in your tool, I.e a tool parameter would be the parcel ID then your attachment path.

0 Kudos
jaykapalczynski
Frequent Contributor

Yea I think that's where I am having my problem...do I create a match table every instance of adding an attachment?  Or one table that I reference each time I add an attachment?  

0 Kudos
DavidPike
MVP Frequent Contributor

I would have thought that you create the match table each time to reference your parcel id

0 Kudos