How to save file in aws s3

I have deployed my app, which generates files (pkl,csv,png…)while running, and I want to upload/download them to/from AWS S3 bucket.

I know we can do that using boto3, but the problem is that I need to save those files first in my working directory then use boto3 to upload/download.

My question is how can I save those files directly in my s3 bucket without passing by my working directory.