Using Path to local files created during execution

I have a question to ask let’s say when I am using the streamlit application locally I can save some of my files during program execution locally then access those files using their path but I don’t think that will be possible if I do this using streamlit sharing.
So how should I go about this?
To make it more clear I am generating some Images and then saving them to a folder then after the images are saved I get the path of these images, use the fpdf module to convert them to a pdf file. I was not able to find any pdf library that directly pastes an image without using the file path. Is there a workaround for this?

Thank you

Hi @dr-one-punch, welcome to the Streamlit community!

Can you use the tempfile library? If I’m remembering correctly, some of the functions create things that behave like files (i.e. get a filesystem location), but never actually leave RAM

https://docs.python.org/3/library/tempfile.html