Select to view content in your preferred language

Publish Hosted Feature Layer without attachments - ArcGIS Online

357
3
Jump to solution
02-26-2025 12:45 PM
mhudson
Occasional Contributor

As the subject states, I'm trying to figure out the best way (if there is one) to publish a new feature layer to ArcGIS Online using Python.

The data is coming from an enterprise geodatabase. The feature class has attachments enabled and the attachments are a ton of photos from inspections.

I have the script working for publishing the feature layer with attachments. However, I don't need all of the attachments included for this scenario. When publishing the layer through ArcGIS Pro, I didn't see a setting anywhere that would allow me to not include the attachments.

The script is creating a 10GB service definition due to all of the photos. This is taking a significant amount of time to create, upload into ArcGIS Online, and then publish.

Any help you could provide would be greatly appreciated!

0 Kudos
1 Solution

Accepted Solutions
BobBooth1
Esri Regular Contributor

Might work to export a copy of the feature layer without attachments, and publish that?

https://support.esri.com/en-us/knowledge-base/how-to-create-a-copy-of-a-feature-class-without-attach...

 

View solution in original post

0 Kudos
3 Replies
BobBooth1
Esri Regular Contributor

Might work to export a copy of the feature layer without attachments, and publish that?

https://support.esri.com/en-us/knowledge-base/how-to-create-a-copy-of-a-feature-class-without-attach...

 

0 Kudos
mhudson
Occasional Contributor

This looks promising. I'll use the arcpy.env.maintainAttachments = False in my script while exporting the features to a new feature class. I'll report back and mark it as a solution if I'm successful.

Thank you!

0 Kudos
mhudson
Occasional Contributor

This will work for our use case! Thank you again for the response.

0 Kudos