Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # make sure you're in an edit session
- fields = [blob_field, file_name] #blob field is your blob field and file_name is the file name field
- with arcpy.da.UpdateCursor(attachments, fields) as rows:
- for r in rows:
- # save to jpg on disk for temp editing
- jpg = r'C:some_path_tosave{}'.format(r[1])
- data = open(jpg, wb).write(r[0].tobytes())
- # do your step 1 with data
- # do your step 2 with data
- # now you're ready to write it back in
- r[0] = open(jpg, 'rb').read()
- rows.updateRow(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement