AnsweredAssumed Answered

Export attachment error

Question asked by BartoszBrzezinski on Sep 1, 2016
Latest reply on Sep 1, 2016 by Dan_Patterson


I`m using this script to export attachments from my geodatabase:


import arcpy
from arcpy import da
import os

inTable = arcpy.GetParameterAsText (0)
fileLocation = arcpy.GetParameterAsText (1)

with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID']) as cursor:

for item in cursor:

attachment = item[0]
filenum = str(item [2]) + "_"
filename = str(item[1])
open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())
del item
del filenum
del filename
del attachment

During procedure i get this warning:

 Do you have idea what is wrong? Thanks for help.