Select to view content in your preferred language

Unable to add docx and xlsx files

460
4
08-30-2022 08:22 AM
jvarasanz
New Contributor III

I've been unable to add attachments with docx or xlxs extension, obtaining an error that states 'The given key was not present in the dictionary'. Converting the docx file to pdf made it work, although I don't see why there needs to be such restriction.

I've obtain the same error using the following:

featureLayer.attachments.add(oid,file_path',keywords='test')
managers.AttachmentManager(featureLayer).add(oid,file_path',keywords='test')

Is this a bug?

Thanks.

Javier

0 Kudos
4 Replies
FrédéricPRALLY
Esri Contributor

Hi,

Could you tell me the service name? Is it starting with a number rather than a letter?

 

Best regards,

Fred

0 Kudos
jvarasanz
New Contributor III

Thanks for your reply Fred.

The service name is Prescribed_Fire_Grant_Application_MASTER_2023. I've used the same code successfully in the past, but I've started having issues after updating to the latest version of ArcGIS Pro.

I hope this helps.

Javier

0 Kudos
RhettZufelt
MVP Notable Contributor

Have you made sure you updated the required drivers for Microsoft stuff as described here?

R_

0 Kudos
jvarasanz
New Contributor III

Still the same result. Note I'm running python on PyCharm which is pointing to ArcGIS Pro.

 

Thanks.

 

Javier

 

 

0 Kudos