Batch downloading and naming attatchments

898
2
Jump to solution
04-09-2021 02:51 PM
AlfredBaldenweck
MVP Regular Contributor

I'm looking to batch download and name photos attached to different features in my data sets.

I've found the Esri documentation  for batch downloading, but that doesn't provide an easy way of telling what photos came from which features.

AlfredBaldenweck_0-1618004795303.png

 

I searched around and found this post on stackexchange, tweaked it to match my data (changing which column to look for names in), and ran it, but it only produces files without a named file extension. 

AlfredBaldenweck_1-1618004810333.png

I did find that I can open them with MS Paint, but how do I get them to be produced as JPGs?

Thanks!

Edit: So, I found a work around using the command prompter to just rename the extensions to jpgs, but I'd still like to have them be produced correctly to avoid that extra step.

1 Solution

Accepted Solutions
MicZatorsky_AEC
Occasional Contributor III

If you use the Esri script that you reference, and if the last part of your output name is "ATT_NAME" it should get a .jpg extension. 

Check the attachment attribute table for the attachment and see if you see file extensions.  If not, edit the script to append ".jpg" to the filename variable, but only  IF you know the attachments are only photos.  This can be tested if you think there may be other document types attached.

View solution in original post

0 Kudos
2 Replies
MicZatorsky_AEC
Occasional Contributor III

If you use the Esri script that you reference, and if the last part of your output name is "ATT_NAME" it should get a .jpg extension. 

Check the attachment attribute table for the attachment and see if you see file extensions.  If not, edit the script to append ".jpg" to the filename variable, but only  IF you know the attachments are only photos.  This can be tested if you think there may be other document types attached.

0 Kudos
AlfredBaldenweck
MVP Regular Contributor

I ended up adding ".jpg" to the file name in the modified user-made script. 

Thanks!

0 Kudos