I’m assuming this is running in a server module in Anvil (and not as an Uplink script).
Anvil does give you a small amount of ephemeral disk space under /tmp (but you cannot rely on anything saved there between server calls).
So you need to either find a way to save your file to /tmp/ or save it as a BytesIO object.
Here’s a link with an example of something similar :
There are other examples in the forum.
1 Like