By "local" content, I mean (mostly) files. JPGs, spreadsheets, text files, etc. These artifacts can be obtained requesting a REST endpoint which can return the contents of a file (the binary)
On ArcGIS Notebook Server I would like to obtain a file's binary, and do something with it, like attach it to a feature.
According to the documentation (https://developers.arcgis.com/python/guide/using-attachments-with-feature-layers/) the attachments.add method requires a path to a file (e.g., C:\\Users\\rohit\\AppData\\Local\\Temp\\AppTemplate.png) , however Notebook Server is not aware of the file system. I've attempted to write the binary to a Python tempfile (https://docs.python.org/3/library/tempfile.html), which successfully writes the file but, it's not usable as an attachment.
Notebook Server on AGOL throws an error of :
Exception: Unable to complete operation.
Adding of attachment failed.
(Error Code: 400)
Executing the on ArcGIS Python API on my local box returns an error of:
[WinError 2] The system cannot find the file specified: 'C:\\Users\\xyz\\AppData\\Local\\Temp\\tmpikjawae3'
tmpikjawae3 is the name of the file in my temp directory
There are tons of other things I'd like to do: carve into text files, create attachments, connect with automations...
Is what I'm asking about possible?