I created a python script tool that exports attachments (jpegs) using the following code:
open(fileLocation + os.sep + str(rel_objectid) + "_" + Name, 'wb').write(binaryRep.tobytes())
Originally, fileLocation was set as arcpy.GetParameterAsText(0), routing to my temp folder. I then changed it to arcpy.env.scratchFolder and also tried ' r"C:\temp". The script tool worked with no issues in ArcGIS Pro. When exporting to WebApp Builder widget, the output is locked and grayed out where I cannot make edits. While I did check the option to allow for export of these image attachments, held in a tableview or dbf, the tool executes but does not return output (the output tab in the widget is blank). Is there an issue with the code itself, as it's intended to write locally? Is it maybe that I will need to subscribe to Image Hosting on AGP?
Any insight is appreciated.